Tomcat class loading and configuration files

Source: Internet
Author: User

The Tomcat server is a servlet/jsp container, more essentially a servlet container, because the JSP is eventually compiled into a servlet to execute

1. Tomcat Web.xml

(1) <welcome-file-list> has the same meaning as the default file in IIS

(2) Error file

If a file resource is not found, the server will report 404 errors, and the above configuration will invoke/webapps/root/notfilefound.jsp.

If a JSP file that executes produces a nullpointexception, the/webapps/root/null.jsp is called

(3) Web.xml First is sure to include its schema.

<web-app xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE"

Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"

xsi:schemalocation= "Http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

version= "2.4" >

</web-app>

(4)

<servlet></servlet> is used to declare data for a servlet, with the following child elements:

<servlet-name></servlet-name> Specify the name of the servlet

<servlet-class></servlet-class> specify the class name of the servlet

<jsp-file></jsp-file> Specify the full path of a JSP page in the Web site

<init-param></init-param> used to define parameters, similar to the previous <init-param>

(5) Similarly, with <servlet></servlet> is used <servlet-mapping></servlet-mapping> to define the corresponding URL of the servlet, Contains two child elements:

<servlet-name></servlet-name> Specify the name of the servlet

<url-pattern></url-pattern> Specify the URL for the servlet

2. Tomcat Directory

Bin:

Conf:server.xml Web.xml

Lib/japser/common: library file.

Src:tomcat Source Code

Webapps:web Publish the directory.

Work:jsp The class file that is generated after compilation.

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.