Class URLHandlerFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.broadleafcommerce.common.web.filter.AbstractIgnorableOncePerRequestFilter
org.broadleafcommerce.cms.web.URLHandlerFilter
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("blURLHandlerFilter") @ConditionalOnNotAdmin public class URLHandlerFilter extends org.broadleafcommerce.common.web.filter.AbstractIgnorableOncePerRequestFilter
Responsible for setting up the site and locale used by Broadleaf Commerce components.
Author:
bpolster
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    Fields inherited from class org.springframework.web.filter.OncePerRequestFilter

    ALREADY_FILTERED_SUFFIX

    Fields inherited from class org.springframework.web.filter.GenericFilterBean

    logger

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doFilterInternalUnlessIgnored(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain)
     
    protected String
    fixQueryString(jakarta.servlet.http.HttpServletRequest request, String url)
    If the url does not include "//" then the system will ensure that the application context is added to the start of the URL.
    static Set<String>
     
    int
     
    protected boolean
     

    Methods inherited from class org.broadleafcommerce.common.web.filter.AbstractIgnorableOncePerRequestFilter

    doFilterInternal, isIgnored

    Methods inherited from class org.springframework.web.filter.OncePerRequestFilter

    doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch

    Methods inherited from class org.springframework.web.filter.GenericFilterBean

    addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • charEncoding

      @Value("${request.uri.encoding}") public String charEncoding
  • Constructor Details

    • URLHandlerFilter

      public URLHandlerFilter()
  • Method Details

    • getExistingQueryParams

      public static Set<String> getExistingQueryParams(String url) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • doFilterInternalUnlessIgnored

      protected void doFilterInternalUnlessIgnored(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException
      Specified by:
      doFilterInternalUnlessIgnored in class org.broadleafcommerce.common.web.filter.AbstractIgnorableOncePerRequestFilter
      Throws:
      jakarta.servlet.ServletException
      IOException
    • fixQueryString

      protected String fixQueryString(jakarta.servlet.http.HttpServletRequest request, String url)
      If the url does not include "//" then the system will ensure that the application context is added to the start of the URL.
      Parameters:
      url -
      Returns:
      Throws:
      Exception
    • getPreserveQueryStringOnRedirect

      protected boolean getPreserveQueryStringOnRedirect()
    • getOrder

      public int getOrder()