| Modifier and Type | Field and Description |
|---|---|
| private CacheControl | |
| private Integer | |
| private Function | |
| private final List | |
| private final List | |
| private boolean | |
| private final String[] | |
| private ResourceChainRegistration | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | ResourceHandlerRegistration(String...
one 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. |
| public ResourceHandlerRegistration | Returns: the sameResourceHandlerRegistration instance, for
chained method invocationthe resource locations to use locations)Configure locations to serve static resources from based on pre-resolved
|
| protected String[] | |
| protected ResourceHttpRequestHandler | |
| 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 | Returns: the sameResourceHandlerRegistration instance, for chained method invocationthe time to cache resources in seconds cachePeriod)Specify the cache period for the resources served by the resource handler, in seconds. |
| 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 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
| |
| cachePeriod | back to summary |
|---|---|
| private Integer cachePeriod
| |
| etagGenerator | back to summary |
|---|---|
| private Function<Resource, String> etagGenerator
| |
| locationsResources | back to summary |
|---|---|
| private final List<Resource> locationsResources | |
| locationValues | back to summary |
|---|---|
| private final List<String> locationValues | |
| optimizeLocations | back to summary |
|---|---|
| private boolean optimizeLocations | |
| pathPatterns | back to summary |
|---|---|
| private final String[] pathPatterns | |
| resourceChainRegistration | back to summary |
|---|---|
| private ResourceChainRegistration resourceChainRegistration
| |
| useLastModified | back to summary |
|---|---|
| private boolean useLastModified | |
| ResourceHandlerRegistration | back to summary |
|---|---|
| public ResourceHandlerRegistration(String... pathPatterns) Create a
| |
| addResourceLocations | back to summary |
|---|---|
| public ResourceHandlerRegistration addResourceLocations(String... locations) 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, { For
| |
| addResourceLocations | back to summary |
|---|---|
| public ResourceHandlerRegistration addResourceLocations(Resource... locations) Configure locations to serve static resources from based on pre-resolved
| |
| getPathPatterns | back to summary |
|---|---|
| protected String[] getPathPatterns() Return the URL path patterns for the resource handler. | |
| getRequestHandler | back to summary |
|---|---|
| protected ResourceHttpRequestHandler getRequestHandler() Return 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 Setting a custom value here will override the configuration set with
| |
| setCachePeriod | back to summary |
|---|---|
| public ResourceHandlerRegistration setCachePeriod(Integer cachePeriod) Specify the cache period for the resources served by the resource handler, in seconds. The default is to not send any cache headers but to rely on last-modified timestamps only. Set to 0 in order to send cache headers that prevent caching, or to a positive number of seconds to send cache headers with the given max-age value.
| |
| 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
| |
| 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
| |