diff --git a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java index 4a35eccce6..fbb626bfd1 100644 --- a/spring-web/src/main/java/org/springframework/web/util/WebUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/WebUtils.java @@ -109,6 +109,7 @@ public abstract class WebUtils { /** * Use of response encoding for HTML escaping parameter at the servlet context level * (i.e. a context-param in {@code web.xml}): "responseEncodedHtmlEscape". + * @since 4.1.2 */ public static final String RESPONSE_ENCODED_HTML_ESCAPE_CONTEXT_PARAM = "responseEncodedHtmlEscape"; @@ -221,6 +222,7 @@ public abstract class WebUtils { * default in case of no setting at the global level. * @param servletContext the servlet context of the web application * @return whether response encoding is used for HTML escaping (null = no explicit default) + * @since 4.1.2 */ public static Boolean getResponseEncodedHtmlEscape(ServletContext servletContext) { if (servletContext == null) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java index 2713461e9a..d6bc7a780e 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java @@ -21,7 +21,6 @@ import java.io.InputStream; import java.net.URLDecoder; import java.util.ArrayList; import java.util.List; - import javax.activation.FileTypeMap; import javax.activation.MimetypesFileTypeMap; import javax.servlet.ServletException; @@ -30,6 +29,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -51,29 +51,30 @@ import org.springframework.web.servlet.support.WebContentGenerator; * (according to the guidelines of Page Speed, YSlow, etc.) by allowing for flexible cache settings * ({@linkplain #setCacheSeconds "cacheSeconds" property}, last-modified support). * - *
The {@linkplain #setLocations "locations" property} takes a list of Spring {@link 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 + *
The {@linkplain #setLocations "locations" property} takes a list of Spring {@link 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. + * 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. + * 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. * - *
For various front-end needs — such as ensuring that users with a primed browser cache get the - * latest changes, or serving variations of resources (e.g., minified versions) — + *
For various front-end needs — such as ensuring that users with a primed browser cache + * get the latest changes, or serving variations of resources (e.g., minified versions) — * {@link org.springframework.web.servlet.resource.ResourceResolver}s can be configured. * *
This handler can be configured through use of a
- * {@link org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry} or the {@code
By default {@link PathResourceResolver} is configured. If using this property, it - * is recommended to add {@link PathResourceResolver} as the last resolver. + *
By default {@link PathResourceResolver} is configured. If using this property,
+ * it is recommended to add {@link PathResourceResolver} as the last resolver.
*/
public void setResourceResolvers(List