Class StaticAssetsRequestHandler

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.craftercms.engine.controller.StaticAssetsRequestHandler
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

public class StaticAssetsRequestHandler extends org.springframework.web.servlet.resource.ResourceHttpRequestHandler
Request handler to render static assets using the ContentStoreService as source.
Author:
Alfonso Vásquez, Jose Ross
  • Field Summary

    Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

    HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.craftercms.core.service.Content
    getContent(SiteContext siteContext, String path)
     
    protected String
    getPath(javax.servlet.http.HttpServletRequest request, SiteContext siteContext)
     
    protected org.springframework.core.io.Resource
    getResource(javax.servlet.http.HttpServletRequest request)
     
    protected void
     
    void
    setContentStoreService(org.craftercms.core.service.ContentStoreService contentStoreService)
     
    void
    setDisableCaching(boolean disableCaching)
     
    void
    setStaticAssetsPath(String staticAssetsPath)
     
    protected org.springframework.core.io.Resource
    toResource(org.craftercms.core.service.Content content, String path)
     

    Methods inherited from class org.springframework.web.servlet.resource.ResourceHttpRequestHandler

    afterPropertiesSet, getContentNegotiationManager, getCorsConfiguration, getLocations, getMediaType, getMediaTypes, getResourceHttpMessageConverter, getResourceRegionHttpMessageConverter, getResourceResolvers, getResourceTransformers, getUrlPathHelper, handleRequest, initAllowedLocations, initContentNegotiationStrategy, isInvalidPath, isOptimizeLocations, isUseLastModified, processPath, setContentNegotiationManager, setCorsConfiguration, setEmbeddedValueResolver, setHeaders, setLocations, setLocationValues, setMediaTypes, setOptimizeLocations, setResourceHttpMessageConverter, setResourceRegionHttpMessageConverter, setResourceResolvers, setResourceTransformers, setUrlPathHelper, setUseLastModified, toString

    Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

    applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders

    Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

    getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext

    Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • StaticAssetsRequestHandler

      public StaticAssetsRequestHandler()
  • Method Details

    • init

      protected void init()
    • setContentStoreService

      public void setContentStoreService(org.craftercms.core.service.ContentStoreService contentStoreService)
    • setStaticAssetsPath

      public void setStaticAssetsPath(String staticAssetsPath)
    • setDisableCaching

      public void setDisableCaching(boolean disableCaching)
    • getResource

      protected org.springframework.core.io.Resource getResource(javax.servlet.http.HttpServletRequest request)
      Overrides:
      getResource in class org.springframework.web.servlet.resource.ResourceHttpRequestHandler
    • toResource

      protected org.springframework.core.io.Resource toResource(org.craftercms.core.service.Content content, String path)
    • getPath

      protected String getPath(javax.servlet.http.HttpServletRequest request, SiteContext siteContext)
    • getContent

      protected org.craftercms.core.service.Content getContent(SiteContext siteContext, String path)