When we learn servlet and JSP technology, in order to facilitate the convenience, we always hope that there is a desktop on your desktop, while Tomcat is slightly troublesome than other commercial servers, but it is not only completely Free, you can get its complete source code and is compatible with the latest servlets and JSP specifications.
download link:
http://jakarta.apache.org/tomcat/ (The latest version is 5.0, this article describes Tomcat4.1.30 as an example)
Note: Because the Servlet API and JSP API require Java 2 platform, it is recommended to install JDK (currently the latest version of 1.5 Beta 1, the relevant configuration of environment variables] This forum has been introduced, and details will not be described here)
Installation:
In Tomcat's official website, you can download two types of installation files. EXE and .ZIP, .. Zip file You only need to decompress, and .exe installation file After you installed, start up at each boot Automatically run the server, this will
Leading to the initiator configuration, if you need to manually start the Tomcat server, it is best to download the .zip file (if it is .exe file, take XP as an example: Start -) Control Panel -> Management Tool -> Service -> To the service called Apache Tomcat 4.1, change the automatic manual)
Configuration article:
In the environment variable, add the following variables:
The following example is installed in C: / J2SDK14, Tomcat installed in the D: / Tomcat4 directory, and the operation is based on specific installation paths:
Java_home = C: / J2SDK14
Catalina_Home = C: / Tomcat4 // Some users reflect the 4.1 version of the above to use Catalina_home instead of Tomcat_home can be successfully configured, leave a reference to you.
Tomcat_Home = C: / Tomcat4
PATH = C: / J2SDK14 / BIN
Classpath = .; c: /j2sdk14/lib/tools.jar; c: /j2sdk14/lib/dt.jar ;; D: / tomcat4 / lib; d: /tomcat4/common/lib/servlet.jar // Configuring servlet Need to add the last one and pay attention to "." Do not miss it, he represents the current directory
In this way, the configuration of the environment variable is completed, enter the Tomcat4 / bin folder, double-click Startup.exe, the console will appear on the desktop, and list some related information, if the console is not flashing, always stay On the desktop, then I want to congratulate you ~~ Configure success :)
Enter: in the IE browser:
http: // localhost: 8080 or
Http://127.0.0.1:8080, you will see a cute, I don't know what the tiger is still a cat. PS: Since it is tomcat, it should be a cat bar :) Haha
Let's take a fun JSP page to test:
code show as below:
<% @ page language = "java"%>
<% @ Page Import = "java.util.date"%>
<% response.setHeader ("Refresh", "1");%>
Auto Refresh EXAMPLE
Refresh Time: 1 SENCORDS
Now Time Is: <% = New Date ()%> Saved to Refresh.jsp Put it to C: / Tomcat4 / WebApps / ROOT, then
Http: // localhost: 8080 / refresh.jsp, you will see a one-second automatic refresh dynamic page.
Hurry up your "Kitten" into your Tomcat journey :)