diff --git a/spring-framework-reference/src/mvc.xml b/spring-framework-reference/src/mvc.xml index 35191f79d0..ca24d78745 100644 --- a/spring-framework-reference/src/mvc.xml +++ b/spring-framework-reference/src/mvc.xml @@ -3414,7 +3414,30 @@ application.version=1.0.0]]> -]]> +]]> + + +
+ mvc:default-servlet-handler + + This tag allows for mapping the DispatcherServlet to "/" (thus overriding the mapping of the container's default Servlet), + while still allowing static resource requests to be handled by the container's default Servlet. It configures a + DefaultServletHttpHandler with a URL mapping (given a lowest precedence order) of "/**". This handler will + forward all requests to the default Servlet. To enable this feature using the default setup, simply include the tag in the form: + + ]]> + + + The caveat to overriding the "/" Servlet mapping is that the RequestDispatcher for the default Servlet must be + retrieved by name rather than by path. The DefaultServletHttpHandler will attempt to auto-detect the default + Servlet for the container at startup time, using a list of known names for most of the major Servlet containers (including Tomcat, + Jetty, Glassfish, JBoss, Resin, WebLogic, and WebSphere). If the default Servlet has been custom configured + with a different name, or if a different Servlet container is being used where the default Servlet name is unknown, then the + default Servlet's name must be explicitly provided as in the following example: + + ]]>