|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.context.config.AbstractFeatureSpecification
org.springframework.web.servlet.config.MvcResources
public final class 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.
| Field Summary |
|---|
| Fields inherited from class org.springframework.context.config.AbstractFeatureSpecification |
|---|
executorType |
| Constructor Summary | |
|---|---|
MvcResources(String mapping,
Resource... resources)
Create an MvcResources specification instance. |
|
MvcResources(String mapping,
String... locations)
Create an MvcResources specification instance. |
|
| Method Summary | |
|---|---|
MvcResources |
cachePeriod(Integer cachePeriod)
The period of time resources should be cached for in seconds. |
MvcResources |
cachePeriod(String cachePeriod)
Specify a cachePeriod as a String. |
protected void |
doValidate(ProblemCollector problems)
|
MvcResources |
order(Integer order)
Specify a cachePeriod as a String. |
MvcResources |
order(String order)
Specify an order as a String. |
| Methods inherited from class org.springframework.context.config.AbstractFeatureSpecification |
|---|
execute, source, source, sourceName, sourceName, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MvcResources(String mapping,
String... locations)
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.
public MvcResources(String mapping,
Resource... resources)
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.| Method Detail |
|---|
public MvcResources cachePeriod(Integer cachePeriod)
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 secondspublic MvcResources cachePeriod(String cachePeriod)
cachePeriod(Integer).
The String must represent an Integer after placeholder and SpEL expression
resolution.
cachePeriod - the cache period in secondspublic MvcResources order(Integer order)
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
Ordered.LOWEST_PRECEDENCE - 1.public MvcResources order(String order)
order(Integer).
The String must represent an Integer after placeholder and SpEL expression
resolution.
order - the order to use. The default value is
Ordered.LOWEST_PRECEDENCE - 1.protected void doValidate(ProblemCollector problems)
doValidate in class AbstractFeatureSpecification
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||