1. Foreword For beginners, Tomcat is a very good choice to execute JSP and Servlet. Tomcat is a product of the Apache organization, and Sun supports it quite well.
2. Download and install.
The download address is the official JAVA site: jakarta.apache.org, which is also available in China. You can download it from this address: http://jakarta.apache.org/builds/tomcat/release/ . I downloaded the Tomcat32b4 version. After downloading, extract it to a directory. I use F:tomcat32b4 as an example.
3.
Select "My Computer" (right-click) on the configuration desktop. For advanced environment variables, go to "System Variables" ---> "New". Enter: JAVA_HOME in the variable name, enter: F:JDK13 in the variable value and then confirm; "System Variables" ---> "New" Enter: TOMCAT_HOME in the variable name, enter: F:tomcat32b4 in the variable value and confirm; OK, after the configuration is completed, the environment variables can only be effective after restarting the computer. Note that for other Tomcat settings, you do not need to change them if it is not necessary. What I will talk about here are the simplest and feasible methods. If you are not sure about your changes, it is still recommended not to change them.
4. Test
(1) Start tomcat: There is one: startup.bat under F:tomcat32b4bin. Run it and a Dos window will appear.
(2) Browse and enter: http://localhost:8080/ in the browser to see what the effect is (Tomcat’s default port is 8080, you can change it as long as there is no conflict), can you see a A cute kitten (in fact, I personally think that it looks more like a tiger in terms of color and appearance)
(3) There are JSP Examples and Servlet Examples running on this page. Well, test and run them yourself.
(4) Exit tomcat There is a shutdown.bat under F:tomcat32b4bin. Running it will close the Dos window (if you insist on closing the DOS window directly, it is also possible, but since there is this shutdown.bat, there should be its reason for existing).