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.