@Component(value="blCacheResourceResolver")
public class BroadleafCachingResourceResolver
extends org.springframework.web.servlet.resource.AbstractResourceResolver
implements org.springframework.core.Ordered
CachingResourceResolver
and instead borrow its code in order to be
able to inject the theme key that is needed by BLC since Spring's class could not be
leveraged otherwise.
Modifier and Type | Field and Description |
---|---|
protected BroadleafContextUtil |
blcContextUtil |
static String |
RESOLVED_RESOURCE_CACHE_KEY_PREFIX |
static String |
RESOLVED_RESOURCE_CACHE_KEY_PREFIX_NULL |
static String |
RESOLVED_URL_PATH_CACHE_KEY_PREFIX |
static String |
RESOLVED_URL_PATH_CACHE_KEY_PREFIX_NULL |
protected boolean |
resourceCachingEnabled |
Constructor and Description |
---|
BroadleafCachingResourceResolver(org.springframework.cache.Cache cache) |
BroadleafCachingResourceResolver(org.springframework.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
protected String |
computeKey(javax.servlet.http.HttpServletRequest request,
String requestPath)
Pulled from
CachingResourceResolver |
org.springframework.cache.Cache |
getCache()
Return the configured
Cache . |
int |
getOrder() |
protected String |
getThemePathFromBRC()
Returns the theme path from the
BroadleafRequestContext or an empty
string if no theme was resolved |
protected org.springframework.core.io.Resource |
resolveResourceInternal(javax.servlet.http.HttpServletRequest request,
String requestPath,
List<? extends org.springframework.core.io.Resource> locations,
org.springframework.web.servlet.resource.ResourceResolverChain chain) |
protected String |
resolveUrlPathInternal(String resourceUrlPath,
List<? extends org.springframework.core.io.Resource> locations,
org.springframework.web.servlet.resource.ResourceResolverChain chain) |
void |
setOrder(int order) |
public static final String RESOLVED_RESOURCE_CACHE_KEY_PREFIX
public static final String RESOLVED_URL_PATH_CACHE_KEY_PREFIX
public static final String RESOLVED_RESOURCE_CACHE_KEY_PREFIX_NULL
public static final String RESOLVED_URL_PATH_CACHE_KEY_PREFIX_NULL
protected BroadleafContextUtil blcContextUtil
@Value(value="${resource.caching.enabled:true}") protected boolean resourceCachingEnabled
@Autowired public BroadleafCachingResourceResolver(@Qualifier(value="blSpringCacheManager") org.springframework.cache.CacheManager cacheManager)
public BroadleafCachingResourceResolver(org.springframework.cache.Cache cache)
public org.springframework.cache.Cache getCache()
Cache
.protected org.springframework.core.io.Resource resolveResourceInternal(javax.servlet.http.HttpServletRequest request, String requestPath, List<? extends org.springframework.core.io.Resource> locations, org.springframework.web.servlet.resource.ResourceResolverChain chain)
resolveResourceInternal
in class org.springframework.web.servlet.resource.AbstractResourceResolver
protected String computeKey(javax.servlet.http.HttpServletRequest request, String requestPath)
CachingResourceResolver
request
- requestPath
- protected String resolveUrlPathInternal(String resourceUrlPath, List<? extends org.springframework.core.io.Resource> locations, org.springframework.web.servlet.resource.ResourceResolverChain chain)
resolveUrlPathInternal
in class org.springframework.web.servlet.resource.AbstractResourceResolver
protected String getThemePathFromBRC()
BroadleafRequestContext
or an empty
string if no theme was resolvedpublic int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setOrder(int order)
Copyright © 2022. All rights reserved.