Generated by
JDiff

org.springframework.web.servlet.resource Documentation Differences

This file contains all the changes in documentation in the package org.springframework.web.servlet.resource as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class DefaultServletHttpRequestHandler

An HttpRequestHandler for serving static files using the Servlet container's "default" Servlet.

This handler is intended to be used with a "/*" mapping when the the DispatcherServlet is mapped to "/", thus overriding the Servlet container's default handling of static resources. The mapping to this handler should generally be ordered as the last in the chain so that it will only execute when no other more specific mappings (i.e., to controllers) can be matched.

Requests are handled by forwarding through the RequestDispatcher obtained via the name specified through the "defaultServletName" property. In most cases, the {@code defaultServletName} does not need to be set explicitly, as the handler checks at initialization time for the presence of the default Servlet of well-known containers such as Tomcat, Jetty, Resin, WebLogic and WebSphere. However, when running in a container where the default Servlet's name is not known, or where it has been customized via server configuration, the {@code defaultServletName} will need to be set explicitly. @author Jeremy Grelle @author Juergen Hoeller @since 3.0.4


Class ResourceHttpRequestHandler

HttpRequestHandler that serves static resources optimized for superior browser performanceperformance (according to the guidelines of Page Speed, YSlow, etc.) by allowing for flexible cache settings (#setCacheSeconds "cacheSeconds" property, last-modified support).

The #setLocations "locations" property takes a list of Spring Resource locations from which static resources are allowed to be served by this handler. For a given request, the list of locations will be consulted in order for the presence of the requested resource, and the first found match will be written to the response, with {@code Expires} and {@code Cache-Control} headers set as configured. The handler also properly evaluates the {@code Last-Modified} header (if present) so that a {@code 304} status code will be returned as appropriate, avoiding unnecessary overhead for resources that are already cached by the client. The use of {@code Resource} locations allows resource requests to easily be mapped to locations other than the web application root. For example, resources could be served from a classpath location such as "classpath:/META-INF/public-web-resources/", allowing convenient packaging and serving of resources such as a JavaScript library from within jar files.

To ensure that users with a primed browser cache get the latest changes to application-specific resources upon deployment of new versions of the application, it is recommended that a version string is used in the URL mapping pattern that selects this handler. Such patterns can be easily parameterized using Spring EL. See the reference manual for further examples of this approach.

Rather than being directly configured as a bean, this handler will typically be configured through use of the {@code } XML configuration element. @author Keith Donald @author Jeremy Grelle @author Juergen Hoeller @since 3.0.4