JSP Tutorials - Herong's Tutorial Examples - 5.10, by Dr. Herong Yang
Outdated: Installing Tomcat 4.1.18
This section provides a tutorial example on how to download and install Apache Tomcat 4.1.18 on a Windows computer. Testing of HTML document and JPS page on the Tomcat server is also provided.
Tomcat is a free, open-source implementation of Java Servlet and JavaServer Pages technologies developed under the Jakarta project at the Apache Software Foundation.
Tomcat 4.1.18 is a web server and supports Servlet 2.3 and JSP 1.2. It requires JDK 1.2 or later. I did the following to get Tomcat 4.1.18 installed on my Windows system:
1. Checked JDK requirement. I had JDK 1.3.1 installed on \local\jdk1.3.1.
2. Downloaded tomcat-4.1.18.zip from http://www.apache.inetcosmos.org/dist/jakarta/tomcat-4/binaries/.
3. Unzipped tomcat-4.1.18.zip in \local.
4. Started Tomcat server:
cd \local\jakarta-tomcat-4.1.18\bin set JAVA_HOME=\local\jdk1.3.1 startup
5. Tomcat created a separate command window, on which I got:
[INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18 [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=30/130 config=C:\local\jakarta- tomcat-4.1.18\bin\..\conf\jk2.properties
6. Ran Internet Explorer (IE) with url: http://localhost:8080. I got the Tomcat home page with the following message on it:
If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
7. To find out where it document root directory of this Web server, let's create hello.html:
<html><body>Hello world!</body></html>
8. Then save hello.html to \local\jakarta-tomcat-4.1.18\webapps\ROOT. Now, run IE with url: http://localhost:8080/hello.html. You should see "Hello world!" in the IE window.
9. To verify if Tomcat supports JSP or not, let's create hello.jsp:
<html><body> <% out.println("Hello world!"); %> </body></html>
10. Then save hello.jsp to \local\jakarta-tomcat-4.1.18\webapps\ROOT. Now, ran IE with url: http://localhost:8080/hello.jsp. You should see "Hello world!" in the IE window.
Congratulations! I have successfully served a JSP page through Tomcat.
Table of Contents
JSP (JavaServer Pages) Overview
Tomcat Installation on Windows Systems
Syntax of JSP Pages and JSP Documents
JavaBean Objects and "useBean" Action Elements
Managing HTTP Response Header Lines
Non-ASCII Characters Support in JSP Pages
Overview of JSTL (JSP Standard Tag Libraries)
Multiple Tags Working Together
Using Tomcat on CentOS Systems
Connecting to SQL Server from Servlet
Developing Web Applications with Servlet
Outdated: Installing GlassFish JSTL 1.2 on Tomcat
Outdated: Downloading and Installing Tomcat 7
Outdated: Installing Tomcat 5.5.7
►Outdated: Installing Tomcat 4.1.18
Outdated: Java Class Converted by Tomcat 4.1.18
Outdated: Hijacking Servlet Converted from JSP
Outdated: Using Perl LWP::Debug Module to Debug
Outdated: Installing JSTL 1.0 Apache Implementation
Outdated: Upgrade JDK 1.3 to JDK 1.4 on Tomcat 4.1
Outdated: Compilation Errors with JDK 1.4