Package org.broadleafcommerce.common.web
Class BroadleafRequestFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.broadleafcommerce.common.web.filter.AbstractIgnorableOncePerRequestFilter
org.broadleafcommerce.common.web.BroadleafRequestFilter
- All Implemented Interfaces:
jakarta.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.core.Ordered,org.springframework.web.context.ServletContextAware
@Component("blRequestFilter")
@ConditionalOnNotAdmin
public class BroadleafRequestFilter
extends AbstractIgnorableOncePerRequestFilter
Responsible for setting up the site and locale used by Broadleaf Commerce components.
- Author:
- bpolster
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic StringParameter/Attribute name for the current languageprotected BroadleafRequestProcessorFields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
loggerFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFilterInternalUnlessIgnored(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) protected SetReturns a set of suffixes that can be ignored by content processing.intgetOrder()protected booleanprotected booleanshouldProcessURL(jakarta.servlet.http.HttpServletRequest request, String requestURI) Determines if the passed in URL should be processed by the content management system.protected booleanshouldProcessURL(jakarta.servlet.http.HttpServletRequest request, String requestURI, boolean ignoreSessionCheck) Methods inherited from class org.broadleafcommerce.common.web.filter.AbstractIgnorableOncePerRequestFilter
doFilterInternal, isIgnoredMethods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Field Details
-
ADMIN_USER_ID_PARAM_NAME
- See Also:
-
REQUEST_DTO_PARAM_NAME
Parameter/Attribute name for the current language -
requestProcessor
-
-
Constructor Details
-
BroadleafRequestFilter
public BroadleafRequestFilter()
-
-
Method Details
-
doFilterInternalUnlessIgnored
protected void doFilterInternalUnlessIgnored(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterInternalUnlessIgnoredin classAbstractIgnorableOncePerRequestFilter- Throws:
IOExceptionjakarta.servlet.ServletException
-
shouldProcessURL
protected boolean shouldProcessURL(jakarta.servlet.http.HttpServletRequest request, String requestURI) Determines if the passed in URL should be processed by the content management system. By default, this method returns false for any BLC-Admin URLs and service calls and for all common image/digital mime-types (as determined by an internal call togetIgnoreSuffixes. This check is called with thedoFilterInternalmethod to short-circuit the content processing which can be expensive for requests that do not require it.- Parameters:
requestURI- - the HttpServletRequest.getRequestURI- Returns:
- true if the
HttpServletRequestshould be processed
-
shouldProcessURL
protected boolean shouldProcessURL(jakarta.servlet.http.HttpServletRequest request, String requestURI, boolean ignoreSessionCheck) -
getIgnoreSuffixes
Returns a set of suffixes that can be ignored by content processing. The following are returned: List of suffixes ignored:".aif", ".aiff", ".asf", ".avi", ".bin", ".bmp", ".doc", ".eps", ".gif", ".hqx", ".jpg", ".jpeg", ".mid", ".midi", ".mov", ".mp3", ".mpg", ".mpeg", ".p65", ".pdf", ".pic", ".pict", ".png", ".ppt", ".psd", ".qxd", ".ram", ".ra", ".rm", ".sea", ".sit", ".stk", ".swf", ".tif", ".tiff", ".txt", ".rtf", ".vob", ".wav", ".wmf", ".xls", ".zip";
- Returns:
- set of suffixes to ignore.
-
shouldNotFilterErrorDispatch
protected boolean shouldNotFilterErrorDispatch()- Overrides:
shouldNotFilterErrorDispatchin classorg.springframework.web.filter.OncePerRequestFilter
-
getOrder
public int getOrder()
-