Skip to content

Commit a8ac6db

Browse files
committed
Polish resource chain documentation
1 parent bf94344 commit a8ac6db

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistration.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,12 +27,11 @@
2727
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
2828

2929
/**
30-
* Encapsulates information required to create a resource handlers.
30+
* Encapsulates information required to create a resource handler.
3131
*
3232
* @author Rossen Stoyanchev
3333
* @author Keith Donald
3434
* @author Brian Clozel
35-
*
3635
* @since 3.1
3736
*/
3837
public class ResourceHandlerRegistration {
@@ -67,7 +66,7 @@ public ResourceHandlerRegistration(ResourceLoader resourceLoader, String... path
6766
* <p>For example, {{@code "/"}, {@code "classpath:/META-INF/public-web-resources/"}} allows resources to
6867
* be served both from the web application root and from any JAR on the classpath that contains a
6968
* {@code /META-INF/public-web-resources/} directory, with resources in the web application root taking precedence.
70-
* @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
69+
* @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
7170
*/
7271
public ResourceHandlerRegistration addResourceLocations(String...resourceLocations) {
7372
for (String location : resourceLocations) {
@@ -81,7 +80,7 @@ public ResourceHandlerRegistration addResourceLocations(String...resourceLocatio
8180
* send any cache headers but to rely on last-modified timestamps only. Set to 0 in order to send cache headers
8281
* that prevent caching, or to a positive number of seconds to send cache headers with the given max-age value.
8382
* @param cachePeriod the time to cache resources in seconds
84-
* @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
83+
* @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
8584
*/
8685
public ResourceHandlerRegistration setCachePeriod(Integer cachePeriod) {
8786
this.cachePeriod = cachePeriod;
@@ -90,16 +89,16 @@ public ResourceHandlerRegistration setCachePeriod(Integer cachePeriod) {
9089

9190
/**
9291
* Configure a chain of resource resolvers and transformers to use. This
93-
* can be useful for example to apply a version strategy to resource URLs.
92+
* can be useful, for example, to apply a version strategy to resource URLs.
9493
*
9594
* <p>If this method is not invoked, by default only a simple
9695
* {@link PathResourceResolver} is used in order to match URL paths to
9796
* resources under the configured locations.
9897
*
9998
* @param cacheResources whether to cache the result of resource resolution;
100-
* setting this to "true" is recommended for production (and "false" for
101-
* development, especially when applying a version strategy).
102-
* @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
99+
* setting this to "true" is recommended for production (and "false" for
100+
* development, especially when applying a version strategy)
101+
* @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
103102
* @since 4.1
104103
*/
105104
public ResourceChainRegistration resourceChain(boolean cacheResources) {
@@ -109,20 +108,21 @@ public ResourceChainRegistration resourceChain(boolean cacheResources) {
109108

110109
/**
111110
* Configure a chain of resource resolvers and transformers to use. This
112-
* can be useful for example to apply a version strategy to resource URLs.
111+
* can be useful, for example, to apply a version strategy to resource URLs.
113112
*
114113
* <p>If this method is not invoked, by default only a simple
115114
* {@link PathResourceResolver} is used in order to match URL paths to
116115
* resources under the configured locations.
117116
*
118117
* @param cacheResources whether to cache the result of resource resolution;
119-
* setting this to "true" is recommended for production (and "false" for
120-
* development, especially when applying a version strategy.
118+
* setting this to "true" is recommended for production (and "false" for
119+
* development, especially when applying a version strategy
121120
* @param cache the cache to use for storing resolved and transformed resources;
122-
* by default a {@link org.springframework.cache.concurrent.ConcurrentMapCache}
123-
* is used. As Resources aren't serializable and can be dependent of the application host,
124-
* one should not use a distributed cache but rather an in-memory cache.
125-
* @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
121+
* by default a {@link org.springframework.cache.concurrent.ConcurrentMapCache}
122+
* is used. Since Resources aren't serializable and can be dependent on the
123+
* application host, one should not use a distributed cache but rather an
124+
* in-memory cache.
125+
* @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
126126
* @since 4.1
127127
*/
128128
public ResourceChainRegistration resourceChain(boolean cacheResources, Cache cache) {

spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.1.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@
491491
<xsd:annotation>
492492
<xsd:documentation><![CDATA[
493493
The name of the Cache Manager to cache resource resolution. By default, a ConcurrentCacheMap will be used.
494-
As Resources aren't serializable and can be dependent of the application host, one should not use a
494+
Since Resources aren't serializable and can be dependent on the application host, one should not use a
495495
distributed cache but rather an in-memory cache.
496496
]]></xsd:documentation>
497497
</xsd:annotation>

0 commit comments

Comments
 (0)