Tomcat, Jetty, JBoss, and GlassFish the name of the default servlet--"default"--"_ah_default"--"Resin-file" The name of the default servlet that WebLogic comes with --"Fileservlet"WebSphere
What's the use of knowing?
If a servlet is configured in Web. XML to intercept all requests, access to some static resources, such as JPG,CSS,JS, is also handled.
If you do not want these requests to be handled by the servlet you configure then you can take the default servlet from the server to intercept the resources first, but make sure that the default Servelt is written in front of the Servelt you configured.
<servlet-mapping> <Servlet-name>Default</Servlet-name> <Url-pattern>*.jpg</Url-pattern> </servlet-mapping> <servlet-mapping> <Servlet-name>Default</Servlet-name> <Url-pattern>*.js</Url-pattern> </servlet-mapping> <servlet-mapping> <Servlet-name>Default</Servlet-name> <Url-pattern>*.css</Url-pattern> </servlet-mapping>
In Tomcat, what is Defaultservlet? What's his function?
All requests first enter Tomcat, which flows through the servlet, and if it does not match any of the application-specific servlets, it will flow to the default servlet
The default servlet is configured in the $catalina/conf/web.xml
The application of some static resources can be handed over to the servlet to deal with, to reduce the pressure on the server, save resources! If you use SPRINGMVC. There will be feelings when you configure
When Org.springframework.web.servlet.DispatcherServlet intercepts all requests, requests for static resources are also intercepted, so you can give the static resources to Defaultservlet to handle!
Default servlet names for various web servers