java.lang.Object
com.broadleafcommerce.resource.security.utils.MatcherUtil

public final class MatcherUtil extends Object
Utility for creating new RequestMatcher instances based on Spring MVC path patterns.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.security.web.util.matcher.RequestMatcher
    mvcRequestMatcher(String pattern, org.springframework.security.config.annotation.web.builders.HttpSecurity http)
    Create a new RequestMatcher instance.
    static org.springframework.security.web.util.matcher.RequestMatcher
    mvcRequestMatcher(String pattern, org.springframework.security.config.annotation.web.builders.HttpSecurity http, String servletPath)
    Create a new RequestMatcher instance.
    static org.springframework.security.web.util.matcher.RequestMatcher
    Create a new RequestMatcher instance that provides backwards compatibility for patterns that contain double wildcards in the middle of the path.
    static org.springframework.security.web.util.matcher.RequestMatcher
    smartPathPattern(org.springframework.http.HttpMethod method, String pattern)
    Create a new RequestMatcher instance that provides backwards compatibility for patterns that contain double wildcards in the middle of the path.

    Methods inherited from class java.lang.Object

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

    • smartPathPattern

      public static org.springframework.security.web.util.matcher.RequestMatcher smartPathPattern(String pattern)
      Create a new RequestMatcher instance that provides backwards compatibility for patterns that contain double wildcards in the middle of the path.
      Parameters:
      pattern - the pattern to match
      Returns:
      a RequestMatcher
    • smartPathPattern

      public static org.springframework.security.web.util.matcher.RequestMatcher smartPathPattern(org.springframework.http.HttpMethod method, String pattern)
      Create a new RequestMatcher instance that provides backwards compatibility for patterns that contain double wildcards in the middle of the path.
      Parameters:
      method - the HTTP method to match
      pattern - the pattern to match
      Returns:
      a RequestMatcher
    • mvcRequestMatcher

      public static org.springframework.security.web.util.matcher.RequestMatcher mvcRequestMatcher(String pattern, org.springframework.security.config.annotation.web.builders.HttpSecurity http)
      Create a new RequestMatcher instance. Defaults to a null servlet path.
      Parameters:
      pattern - The mvc matching pattern
      http - The security context being modified
      Returns:
      A new RequestMatcher instance
    • mvcRequestMatcher

      public static org.springframework.security.web.util.matcher.RequestMatcher mvcRequestMatcher(String pattern, org.springframework.security.config.annotation.web.builders.HttpSecurity http, String servletPath)
      Create a new RequestMatcher instance. This method is most interesting if more than one mappable servlet is registered in the servlet context, and you need to explicitly associate the pattern with a particular servlet based on the servlet path. In general, targeting this method with a servletPath of "" is desired in order to target the default servlet context.
      Parameters:
      pattern - The mvc matching pattern
      http - The security context being modified
      servletPath - The servlet path for the servlet to which the matcher should be associated.
      Returns:
      A new RequestMatcher instance