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
    StaticAssetsRequestHandler(org.craftercms.core.service.ContentStoreService contentStoreService, boolean disableCaching)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.craftercms.core.service.Content
    getContent(SiteContext siteContext, String path)
     
    protected org.springframework.http.MediaType
    getMediaType(jakarta.servlet.http.HttpServletRequest request, org.springframework.core.io.Resource resource)
     
    protected String
    getPath(jakarta.servlet.http.HttpServletRequest request, SiteContext siteContext)
     
    protected org.springframework.core.io.Resource
    getResource(jakarta.servlet.http.HttpServletRequest request)
     
    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, getEtagGenerator, getLocations, getMediaTypes, getResourceHttpMessageConverter, getResourceRegionHttpMessageConverter, getResourceResolvers, getResourceTransformers, getUrlPathHelper, handleRequest, initAllowedLocations, initContentNegotiationStrategy, isInvalidPath, isOptimizeLocations, isUseLastModified, processPath, setContentNegotiationManager, setCorsConfiguration, setEmbeddedValueResolver, setEtagGenerator, setHeaders, setLocations, setLocationValues, setMediaTypes, setOptimizeLocations, setResourceHttpMessageConverter, setResourceRegionHttpMessageConverter, setResourceResolvers, setResourceTransformers, setUrlPathHelper, setUseLastModified, toString

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

    applyCacheControl, applyCacheSeconds, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, 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(org.craftercms.core.service.ContentStoreService contentStoreService, boolean disableCaching)
  • Method Details

    • setStaticAssetsPath

      public void setStaticAssetsPath(String staticAssetsPath)
    • getMediaType

      protected org.springframework.http.MediaType getMediaType(jakarta.servlet.http.HttpServletRequest request, org.springframework.core.io.Resource resource)
      Overrides:
      getMediaType in class org.springframework.web.servlet.resource.ResourceHttpRequestHandler
    • getResource

      protected org.springframework.core.io.Resource getResource(jakarta.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(jakarta.servlet.http.HttpServletRequest request, SiteContext siteContext)
    • getContent

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