SoFunction
Updated on 2025-04-09

JAVA/JSP Learning Series 2


1. Preface

For beginners, Tomcat is a good choice to execute JSP and Servlets. Tomcat is a product of Apache, and Sun's support for it is quite good.

2. Download and install

The download address is JAVA official website: There are also many in China.

From this address, you can download: /builds/tomcat/release/, I downloaded the Tomcat32b4 version.

After downloading, unzip it to a directory. I use F: omcat32b4 as an example.

3. Configuration

Select "My Computer" on the desktop (right-click)

advanced

Environment variables

In "System Variables" ---> "New"

Enter: JAVA_HOME in the variable name, enter: F: JDK13 in the variable value and then confirm;

In "System Variables" ---> "New"

Enter: TOMCAT_HOME in the variable name, enter: F: omcat32b4 and then OK;

OK, the configuration is completed, and the environment variables must be valid after restarting the computer.

Note that for other Tomcat settings, if not necessary, you can not change them. What I am talking about here is the easiest and feasible method. If you are not sure about your changes, it is recommended not to change them.

4. Test

(1) Start tomcat:

Under F: omcat32b4in there is a:, run it, and a Dos window will appear.

(2) View

Enter: http://localhost:8080/ to see what effect it has (Tomcat default port is 8080, you can change it without conflict), can you see a cute kitten (actually, I personally think that it looks more like a tiger in terms of color and appearance)

(3) Run

There are JSP Examples and Servlet Examples on this page. OK, test and run them yourself.

(4) Exit tomcat

Under F: omcat32b4in, there is a:, running it will close the Dos window (it is OK if you insist on closing this DOS window directly, but since there is this, there should be a reason for it to exist). (Source:)