Tomcat 4 Getting Started Guide

Source: Internet
Author: User
Tags tomcat tomcat server
With the advent of the Catalina Servlet engine, Tomcat fourth, dubbed its performance improvement, made it a servlet/jsp container to consider. However, there are very few books that can help you begin to understand Tomcat, and few of the information on the Jakarta Web site is clear.
Let's take a step-by-step look at the setup process for Tomcat, and then discuss using some of the Tomcat 4/jsp features to build Web application software.
What is Tomcat?
Tomcat is an open-source, Java-based Web application container that runs servlet and JSP Web application software. Tomcat is supported by the Apache-jakarta subproject and is maintained by volunteers from the open source Java community. Tomcat server is executed according to the servlet and JSP specifications, so we can say that Tomcat server also implements the Apache-jakarta specification and is better than most commercial application software servers.
Install Tomcat 4
To start using Tomcat 4, you should download at least Java Development Kit (JDK) version 1.2 and Tomcat 4 installation packs, which are zip files and Windows Installer packages. Once you have installed these two packets, you must add two environment variables: Java_home and Tomcat_home. The JDK will be installed in the Java_home directory, while Tomcat 4 will be installed in the Tomcat_home directory.
If installed through Windows Installer, you can use the menu option to start Tomcat, or open a command prompt window to enter the Tomcat_homein directory and run the startup.bat/sh file. Then open a browser and enter the URL http://localhost:8080. The default Tomcat page will appear in front of you.
Web application Software Primer
Before we begin, let's review the parts that a Web application contains. The Java servlet specification defines Web applications as a collection of servlets,html pages, classes, and other resources that are bundled and run on multiple containers from multiple marketers. In Tomcat, these resources are placed in a special directory structure below the Tomcat_homewebapps folder. For a sample of a Web application (MyApp) This directory structure would be:
Tomcat_homewebappsmyappweb-infclasseslib
The MyApp directory is considered the root of the Web application software, and all jsp,html,javascript files and other resources are located under this directory. The Web-inf directory contains the resources used by the application, but the Web-inf is not in the public document root directory. The files contained in this directory cannot be accessed by the client. The class directory (under Web-inf) contains the Servlets,beans and utility classes required to run MyApp. In some instances (log4j), the property file is placed in the directory of the class. The Lib directory (under Web-inf) contains Java archive files (JARs), such as a JDBC drive or tag library, which MyApp relies on. If a class appears in the jar file and in the class's directory, the class loader loads the one in the class directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.