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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ScriptFilter.FilterMapping
-
Field Summary
Fields Modifier and Type Field Description protected boolean
disableVariableRestrictions
static String
EXCLUDE_MAPPINGS_KEY
protected org.springframework.security.web.util.matcher.RequestMatcher
excludedUrlsMatcher
static String
FILTER_KEY
static String
FILTER_MAPPINGS_CACHE_KEY
static String
INCLUDE_MAPPINGS_KEY
protected org.springframework.util.PathMatcher
pathMatcher
protected PluginService
pluginService
static String
SCRIPT_KEY
-
Constructor Summary
Constructors Constructor Description ScriptFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain originalChain)
protected boolean
excludeFilter(String requestUri, String[] excludes)
protected List<ScriptFilter.FilterMapping>
getFilterMappings()
protected javax.servlet.FilterChain
getScriptFilterChain(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.FilterChain chain)
protected boolean
includeFilter(String requestUri, String[] includes)
void
init(javax.servlet.FilterConfig filterConfig)
void
setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
void
setDisableVariableRestrictions(boolean disableVariableRestrictions)
void
setExcludedUrls(String[] excludedUrls)
void
setPathMatcher(org.springframework.util.PathMatcher pathMatcher)
void
setPluginService(PluginService pluginService)
-
-
-
Field Detail
-
FILTER_KEY
public static final String FILTER_KEY
- See Also:
- Constant Field Values
-
SCRIPT_KEY
public static final String SCRIPT_KEY
- See Also:
- Constant Field Values
-
INCLUDE_MAPPINGS_KEY
public static final String INCLUDE_MAPPINGS_KEY
- See Also:
- Constant Field Values
-
EXCLUDE_MAPPINGS_KEY
public static final String EXCLUDE_MAPPINGS_KEY
- See Also:
- Constant Field Values
-
FILTER_MAPPINGS_CACHE_KEY
public static final String FILTER_MAPPINGS_CACHE_KEY
- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
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 interfacejavax.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 interfacejavax.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 interfacejavax.servlet.Filter
-
getFilterMappings
protected List<ScriptFilter.FilterMapping> getFilterMappings()
-
-