Improve docs for MvcDefaultServletHandler container feature.

master
Rossen Stoyanchev 14 years ago
parent 98d798dbe4
commit 4027cbd952
  1. 7
      org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/config/MvcDefaultServletHandler.java
  2. 4
      org.springframework.web.servlet/src/main/resources/org/springframework/web/servlet/config/spring-mvc-3.1.xsd
  3. 12
      spring-framework-reference/src/mvc.xml

@ -33,6 +33,13 @@ import org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler
* <li>{@link HttpRequestHandlerAdapter} to enable the DispatcherServlet to be
* able to invoke the above request handler.
* </ul>
*
* This handler will forward all requests to the default Servlet. Therefore
* it is important that it remains last in the order of all other URL
* HandlerMappings. That will be the case if you use the {@link MvcAnnotationDriven}
* feature or alternatively if you are setting up your customized HandlerMapping
* instance be sure to set its "order" property to a value lower than that of
* the DefaultServletHttpRequestHandler, which is Integer.MAX_VALUE.
*
* @author Rossen Stoyanchev
* @since 3.1

@ -171,6 +171,10 @@
Configures a handler for serving static resources by forwarding to the Servlet container's default Servlet. Use of this
handler allows using a "/" mapping with the DispatcherServlet while still utilizing the Servlet container to serve static
resources.
This handler will forward all requests to the default Servlet. Therefore it is important that it remains last in the
order of all other URL HandlerMappings. That will be the case if you use the "annotation-driven" element or alternatively
if you are setting up your customized HandlerMapping instance be sure to set its "order" property to a value lower than
that of the DefaultServletHttpRequestHandler, which is Integer.MAX_VALUE.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>

@ -3509,8 +3509,16 @@ application.version=1.0.0]]>
<para>
This tag allows for mapping the <code>DispatcherServlet</code> 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
<code>DefaultServletHttpRequestHandler</code> 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:
<code>DefaultServletHttpRequestHandler</code> with a URL mapping of "/**" and the lowest priority relative to other URL mappings.
</para>
<para>
This handler will forward all requests to the default Servlet. Therefore it is important that it remains last in the order of all
other URL <code>HandlerMappings</code>. That will be the case if you use <code>&lt;mvc:annotation-driven&gt;</code> or alternatively if you
are setting up your own customized <code>HandlerMapping</code> instance be sure to set its <code>order</code> property to a value lower than
that of the <code>DefaultServletHttpRequestHandler</code>, which is <code>Integer.MAX_VALUE</code>.
</para>
<para>
To enable the feature using the default setup, simply include the tag in the form:
</para>
<programlisting language="xml"><![CDATA[
<mvc:default-servlet-handler/>]]>

Loading…
Cancel
Save