|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration
public class ResourceHandlerRegistration
Encapsulates information required to create a resource handlers.
Constructor Summary | |
---|---|
ResourceHandlerRegistration(ResourceLoader resourceLoader,
String... pathPatterns)
Create a ResourceHandlerRegistration instance. |
Method Summary | |
---|---|
ResourceHandlerRegistration |
addResourceLocations(String... resourceLocations)
Add one or more resource locations from which to serve static content. |
protected String[] |
getPathPatterns()
Returns the URL path patterns for the resource handler. |
protected ResourceHttpRequestHandler |
getRequestHandler()
Returns a ResourceHttpRequestHandler instance. |
ResourceHandlerRegistration |
setCachePeriod(Integer cachePeriod)
Specify the cache period for the resources served by the resource handler, in seconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceHandlerRegistration(ResourceLoader resourceLoader, String... pathPatterns)
ResourceHandlerRegistration
instance.
resourceLoader
- a resource loader for turning a String location into a Resource
pathPatterns
- one or more resource URL path patternsMethod Detail |
---|
public ResourceHandlerRegistration addResourceLocations(String... resourceLocations)
For example, {"/"
, "classpath:/META-INF/public-web-resources/"
} allows resources to
be served both from the web application root and from any JAR on the classpath that contains a
/META-INF/public-web-resources/
directory, with resources in the web application root taking precedence.
ResourceHandlerRegistration
instance for chained method invocationpublic ResourceHandlerRegistration setCachePeriod(Integer cachePeriod)
cachePeriod
- the time to cache resources in seconds
ResourceHandlerRegistration
instance for chained method invocationprotected String[] getPathPatterns()
protected ResourceHttpRequestHandler getRequestHandler()
ResourceHttpRequestHandler
instance.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |