Class BroadleafResourceHttpRequestHandler
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.resource.ResourceHttpRequestHandler
org.broadleafcommerce.common.web.resource.BroadleafResourceHttpRequestHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.EmbeddedValueResolverAware,org.springframework.web.context.ServletContextAware,org.springframework.web.cors.CorsConfigurationSource,org.springframework.web.HttpRequestHandler
- Direct Known Subclasses:
CacheAwareResponseHandler
public class BroadleafResourceHttpRequestHandler
extends org.springframework.web.servlet.resource.ResourceHttpRequestHandler
Provides a PostConstruct method that sorts the
ResourceResolver, ResourceTransformer,
or location (Resource) collections based on the Ordered interface.- Author:
- bpolster
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classItems that implement Ordered will sort by the value ofOrdered.getOrder(). -
Field Summary
FieldsFields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected voidsetHeaders(jakarta.servlet.http.HttpServletResponse response, org.springframework.core.io.Resource resource, org.springframework.http.MediaType mediaType) protected voidMethods inherited from class org.springframework.web.servlet.resource.ResourceHttpRequestHandler
afterPropertiesSet, getContentNegotiationManager, getCorsConfiguration, getEtagGenerator, getLocations, getMediaType, getMediaTypes, getResource, getResourceHttpMessageConverter, getResourceRegionHttpMessageConverter, getResourceResolvers, getResourceTransformers, getUrlPathHelper, initAllowedLocations, initContentNegotiationStrategy, isInvalidPath, isOptimizeLocations, isUseLastModified, processPath, setContentNegotiationManager, setCorsConfiguration, setEmbeddedValueResolver, setEtagGenerator, setLocations, setLocationValues, setMediaTypes, setOptimizeLocations, setResourceHttpMessageConverter, setResourceRegionHttpMessageConverter, setResourceResolvers, setResourceTransformers, setUrlPathHelper, setUseLastModified, toStringMethods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheControl, applyCacheSeconds, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setVaryByRequestHeadersMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
blcContextUtil
-
cacheSeconds
@Value("${staticResourceBrowserCacheSeconds}") protected long cacheSeconds
-
-
Constructor Details
-
BroadleafResourceHttpRequestHandler
public BroadleafResourceHttpRequestHandler()
-
-
Method Details
-
sortCollections
@PostConstruct protected void sortCollections() -
handleRequest
public void handleRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Specified by:
handleRequestin interfaceorg.springframework.web.HttpRequestHandler- Overrides:
handleRequestin classorg.springframework.web.servlet.resource.ResourceHttpRequestHandler- Throws:
jakarta.servlet.ServletExceptionIOException
-
setHeaders
protected void setHeaders(jakarta.servlet.http.HttpServletResponse response, org.springframework.core.io.Resource resource, org.springframework.http.MediaType mediaType) throws IOException - Overrides:
setHeadersin classorg.springframework.web.servlet.resource.ResourceHttpRequestHandler- Throws:
IOException
-