Conf/web. xml ------------- org. apache. catalina. servlets. DefaultServlet, tomcatconfcatalina
1.org. apache. catalina. servlets. DefaultServlet
<servlet> <servlet-name>default</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>false</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- The mapping for the default servlet --> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
First, all requests entering tomcat will flow through the servlet. If no servlet specified by the application is matched, it will flow to the default servlet. The default servlet is configured in/conf/web. xml. What is defined in the configuration file will be loaded at Tomcat startup, which is valid for all webapps.