Default servlet names for various web servers

Source: Internet
Author: User

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

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.