java.lang.Object | ||
↳ | org.springframework.context.config.AbstractFeatureSpecification | |
↳ | org.springframework.web.servlet.config.MvcResources |
Specifies the Spring MVC "resources" container feature. The feature provides the following fine-grained configuration:
ResourceHttpRequestHandler
to serve static resources from a
list of web-root relative, classpath, or other locations.
SimpleUrlHandlerMapping
to map the above request handler to a
a specific path pattern (e.g. "/resources/**").
HttpRequestHandlerAdapter
to enable the DispatcherServlet to be
able to invoke the above request handler.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.config.AbstractFeatureSpecification
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create an MvcResources specification instance.
| |||||||||||
Create an MvcResources specification instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The period of time resources should be cached for in seconds.
| |||||||||||
Specify a cachePeriod as a String.
| |||||||||||
Specify an order as a String.
| |||||||||||
Specify a cachePeriod as a String.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.config.AbstractFeatureSpecification
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.context.config.FeatureSpecification
| |||||||||||
From interface
org.springframework.context.config.SourceAwareSpecification
|
Create an MvcResources specification instance. See alternate constructor
you prefer to use Resource
instances instead of String
-based
resource locations.
mapping | - the URL path pattern within the current Servlet context to use to identify resource requests (e.g. "/resources/**"). |
---|---|
locations | - locations of resources containing static content to be served. Each location must point to a valid directory. Locations will be checked in the order specified. For example if "/" and "classpath:/META-INF/public-web-resources/" are configured resources will be served from the Web root and from any JAR on the classpath that contains a /META-INF/public-web-resources/ directory, with resources under the Web root taking precedence. |
Create an MvcResources specification instance. See alternate constructor defined here if you prefer to use String-based path patterns.
mapping | - the URL path pattern within the current Servlet context to use to identify resource requests (e.g. "/resources/**"). |
---|---|
resources | - Spring Resource objects containing static
content to be served. Resources will be checked in the order specified.
|
The period of time resources should be cached for in seconds. The default is to not send any cache headers but rather to rely on last-modified timestamps only.
Set this to 0 in order to send cache headers that prevent caching, or to a positive number of seconds in order to send cache headers with the given max-age value.
cachePeriod | the cache period in seconds |
---|
Specify a cachePeriod as a String. An alternative to cachePeriod(Integer)
.
The String must represent an Integer after placeholder and SpEL expression
resolution.
cachePeriod | the cache period in seconds |
---|
Specify an order as a String. An alternative to order(Integer)
.
The String must represent an Integer after placeholder and SpEL expression
resolution.
order | the order to use. The default value is
LOWEST_PRECEDENCE - 1.
|
---|
Specify a cachePeriod as a String. An alternative to cachePeriod(Integer)
.
The String must represent an Integer after placeholder and SpEL expression
resolution.
Sets the order for the SimpleUrlHandlerMapping used to match resource
requests relative to order value for other HandlerMapping instances
such as the DefaultAnnotationHandlerMapping
used to match
controller requests.
order | the order to use. The default value is
LOWEST_PRECEDENCE - 1.
|
---|