The default resource-serving servlet for most web applications, used to serve static resources such as HTML pages and images.
This servlet is intended to be mapped to / e.g.:
<servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
It can be mapped to sub-paths, however in all cases resources are served from the web appplication resource root using the full path from the root of the web application context.
e.g. given a web application structure:
/context /images tomcat2.jpg /static /images tomcat.jpg
... and a servlet mapping that maps only /static/*
to the default servlet:
<servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/static/*</url-pattern> </servlet-mapping>
Then a request to /context/static/images/tomcat.jpg
will succeed while a request to /context/images/tomcat2.jpg
will fail.
@author Craig R. McClanahan
@author Remy Maucherat
@version $Id: DefaultServlet.java 1549711 2013-12-09 23:43:15Z markt $