Class ScriptFilter

java.lang.Object
org.craftercms.engine.scripting.impl.ScriptFilter
All Implemented Interfaces:
javax.servlet.Filter

public class ScriptFilter extends Object implements javax.servlet.Filter
Servlet filter that passes the request through a series of scripts that act as filters too.
Author:
avasquez
  • Field Details

    • FILTER_KEY

      public static final String FILTER_KEY
      See Also:
    • SCRIPT_KEY

      public static final String SCRIPT_KEY
      See Also:
    • INCLUDE_MAPPINGS_KEY

      public static final String INCLUDE_MAPPINGS_KEY
      See Also:
    • EXCLUDE_MAPPINGS_KEY

      public static final String EXCLUDE_MAPPINGS_KEY
      See Also:
    • FILTER_MAPPINGS_CACHE_KEY

      public static final String FILTER_MAPPINGS_CACHE_KEY
      See Also:
    • pathMatcher

      protected org.springframework.util.PathMatcher pathMatcher
    • disableVariableRestrictions

      protected boolean disableVariableRestrictions
    • pluginService

      protected PluginService pluginService
    • excludedUrlsMatcher

      protected org.springframework.security.web.util.matcher.RequestMatcher excludedUrlsMatcher
  • Constructor Details

    • ScriptFilter

      public ScriptFilter()
  • Method Details

    • setCacheTemplate

      public void setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
    • setPathMatcher

      public void setPathMatcher(org.springframework.util.PathMatcher pathMatcher)
    • setDisableVariableRestrictions

      public void setDisableVariableRestrictions(boolean disableVariableRestrictions)
    • setPluginService

      public void setPluginService(PluginService pluginService)
    • setExcludedUrls

      public void setExcludedUrls(String[] excludedUrls)
    • init

      public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
      Specified by:
      init in interface javax.servlet.Filter
      Throws:
      javax.servlet.ServletException
    • doFilter

      public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain originalChain) throws IOException, javax.servlet.ServletException
      Specified by:
      doFilter in interface javax.servlet.Filter
      Throws:
      IOException
      javax.servlet.ServletException
    • getScriptFilterChain

      protected javax.servlet.FilterChain getScriptFilterChain(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.FilterChain chain)
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Filter
    • getFilterMappings

      protected List<ScriptFilter.FilterMapping> getFilterMappings()
    • excludeFilter

      protected boolean excludeFilter(String requestUri, String[] excludes)
    • includeFilter

      protected boolean includeFilter(String requestUri, String[] includes)