| Modifier and Type | Field and Description |
|---|---|
| private CacheControl | |
| private Function | |
| private final List | |
| private Map | |
| private boolean | |
| private final String[] | |
| private ResourceChainRegistration | |
| private final ResourceLoader | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | ResourceHandlerRegistration(ResourceLoader
a resource loader for turning a String location
into a resourceLoader, String... Resourceone or more resource URL path patterns pathPatterns)Create a |
| Modifier and Type | Method and Description |
|---|---|
| public ResourceHandlerRegistration | Returns: the sameResourceHandlerRegistration instance, for
chained method invocationAdd one or more resource locations from which to serve static content. |
| protected String[] | |
| protected ResourceWebHandler | |
| public ResourceChainRegistration | Returns: the sameResourceHandlerRegistration instance, for
chained method invocationwhether to cache the result of resource resolution;
setting this to "true" is recommended for production (and "false" for
development, especially when applying a version strategy) cacheResources)Configure a chain of resource resolvers and transformers to use. |
| public ResourceChainRegistration | Returns: the sameResourceHandlerRegistration instance, for chained method invocationwhether to cache the result of resource resolution;
setting this to "true" is recommended for production (and "false" for
development, especially when applying a version strategy cacheResources, Cache the cache to use for storing resolved and transformed resources;
by default a cache)org.
is used. Since Resources aren't serializable and can be dependent on the
application host, one should not use a distributed cache but rather an
in-memory cache.Configure a chain of resource resolvers and transformers to use. |
| public ResourceHandlerRegistration | Returns: the sameResourceHandlerRegistration instance, for
chained method invocationthe CacheControl configuration to use cacheControl)Specify the |
| public ResourceHandlerRegistration | setEtagGenerator(Function<Resource, String>
the HTTP ETag generator function to use. etagGenerator)Configure a generator function that will be used to create the ETag information,
given a |
| public void | setMediaTypes(Map<String, MediaType>
media type mappings mediaTypes)Add mappings between file extensions extracted from the filename of static
|
| public ResourceHandlerRegistration | Returns: the sameResourceHandlerRegistration instance, for chained method invocationwhether to optimize the locations through an existence check on startup optimizeLocations)Set whether to optimize the specified locations through an existence check on startup, filtering non-existing directories upfront so that they do not have to be checked on every resource access. |
| public ResourceHandlerRegistration | Returns: the sameResourceHandlerRegistration instance, for chained method invocationwhether the "last modified" resource information should be used useLastModified)Set whether the |
| cacheControl | back to summary |
|---|---|
| private CacheControl cacheControl
| |
| etagGenerator | back to summary |
|---|---|
| private Function<Resource, String> etagGenerator
| |
| locationValues | back to summary |
|---|---|
| private final List<String> locationValues | |
| mediaTypes | back to summary |
|---|---|
| private Map<String, MediaType> mediaTypes
| |
| optimizeLocations | back to summary |
|---|---|
| private boolean optimizeLocations | |
| pathPatterns | back to summary |
|---|---|
| private final String[] pathPatterns | |
| resourceChainRegistration | back to summary |
|---|---|
| private ResourceChainRegistration resourceChainRegistration
| |
| resourceLoader | back to summary |
|---|---|
| private final ResourceLoader resourceLoader | |
| useLastModified | back to summary |
|---|---|
| private boolean useLastModified | |
| ResourceHandlerRegistration | back to summary |
|---|---|
| public ResourceHandlerRegistration(ResourceLoader resourceLoader, String... pathPatterns) Create a
| |
| addResourceLocations | back to summary |
|---|---|
| public ResourceHandlerRegistration addResourceLocations(String... resourceLocations) Add one or more resource locations from which to serve static content. Each location must point to a valid directory. Multiple locations may be specified as a comma-separated list, and the locations will be checked for a given resource in the order specified. For example,
| |
| getPathPatterns | back to summary |
|---|---|
| protected String[] getPathPatterns() Returns the URL path patterns for the resource handler. | |
| getRequestHandler | back to summary |
|---|---|
| protected ResourceWebHandler getRequestHandler() Returns a | |
| resourceChain | back to summary |
|---|---|
| public ResourceChainRegistration resourceChain(boolean cacheResources) Configure a chain of resource resolvers and transformers to use. This can be useful, for example, to apply a version strategy to resource URLs. If this method is not invoked, by default only a simple
| |
| resourceChain | back to summary |
|---|---|
| public ResourceChainRegistration resourceChain(boolean cacheResources, Cache cache) Configure a chain of resource resolvers and transformers to use. This can be useful, for example, to apply a version strategy to resource URLs. If this method is not invoked, by default only a simple
| |
| setCacheControl | back to summary |
|---|---|
| public ResourceHandlerRegistration setCacheControl(CacheControl cacheControl) Specify the
| |
| setEtagGenerator | back to summary |
|---|---|
| public ResourceHandlerRegistration setEtagGenerator(Function<Resource, String> etagGenerator) Configure a generator function that will be used to create the ETag information,
given a This function should return a String that will be used as an argument in
| |
| setMediaTypes | back to summary |
|---|---|
| public void setMediaTypes(Map<String, MediaType> mediaTypes) Add mappings between file extensions extracted from the filename of static
Use of this method is typically not necessary since mappings can be
also determined via | |
| setOptimizeLocations | back to summary |
|---|---|
| public ResourceHandlerRegistration setOptimizeLocations(boolean optimizeLocations) Set whether to optimize the specified locations through an existence check on startup, filtering non-existing directories upfront so that they do not have to be checked on every resource access. The default is
| |
| setUseLastModified | back to summary |
|---|---|
| public ResourceHandlerRegistration setUseLastModified(boolean useLastModified) Set whether the This configuration is set to
| |