Class ParameterRequestMatcher

java.lang.Object
org.springframework.security.web.util.matcher.ParameterRequestMatcher
All Implemented Interfaces:
RequestMatcher

public final class ParameterRequestMatcher extends Object implements RequestMatcher
A RequestMatcher for matching on a request parameter and its value.

The value may also be specified as a placeholder in order to match on any value, returning the value as part of the RequestMatcher.MatchResult.

Since:
6.4
  • Constructor Details

    • ParameterRequestMatcher

      public ParameterRequestMatcher(String name)
    • ParameterRequestMatcher

      public ParameterRequestMatcher(String name, String value)
  • Method Details

    • matches

      public boolean matches(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: RequestMatcher
      Decides whether the rule implemented by the strategy matches the supplied request.
      Specified by:
      matches in interface RequestMatcher
      Parameters:
      request - the request to check for a match
      Returns:
      true if the request matches, false otherwise
    • matcher

      public RequestMatcher.MatchResult matcher(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: RequestMatcher
      Returns a MatchResult for this RequestMatcher The default implementation returns Collections.emptyMap() when RequestMatcher.MatchResult.getVariables() is invoked.
      Specified by:
      matcher in interface RequestMatcher
      Returns:
      the MatchResult from comparing this RequestMatcher against the HttpServletRequest