Browse Source

Use MvcRequestMatcher by default if Spring MVC is present

Closes gh-11899
Marcus Da Coregio 2 years ago
parent
commit
c4d23f2b49
82 changed files with 391 additions and 177 deletions
  1. 2 2
      config/src/main/java/org/springframework/security/config/http/AuthorizationFilterParser.java
  2. 2 2
      config/src/main/java/org/springframework/security/config/http/FilterChainBeanDefinitionParser.java
  3. 2 2
      config/src/main/java/org/springframework/security/config/http/FilterChainMapBeanDefinitionDecorator.java
  4. 1 1
      config/src/main/java/org/springframework/security/config/http/FilterInvocationSecurityMetadataSourceParser.java
  5. 1 1
      config/src/main/java/org/springframework/security/config/http/HttpConfigurationBuilder.java
  6. 2 2
      config/src/main/java/org/springframework/security/config/http/HttpSecurityBeanDefinitionParser.java
  7. 19 3
      config/src/main/java/org/springframework/security/config/http/MatcherType.java
  8. 7 5
      config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java
  9. 10 8
      config/src/test/java/org/springframework/security/config/http/FilterSecurityMetadataSourceBeanDefinitionParserTests.java
  10. 13 5
      config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java
  11. 18 0
      config/src/test/resources/org/springframework/security/config/http/CsrfBeanDefinitionParserTests-RegisterDataValueProcessorOnyIfNotRegistered.xml
  12. 3 2
      config/src/test/resources/org/springframework/security/config/http/CsrfConfigTests-CsrfEnabled.xml
  13. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-CamelCasePathVariables.xml
  14. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-CamelCasePathVariablesAuthorizationManager.xml
  15. 33 0
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-DefaultMatcherNoIntrospectorBean.xml
  16. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-DefaultMatcherServletPath.xml
  17. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-DefaultMatcherServletPathAuthorizationManager.xml
  18. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PatchMethod.xml
  19. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PatchMethodAuthorizationManager.xml
  20. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PathVariables.xml
  21. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PathVariablesAuthorizationManager.xml
  22. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-Sec2256.xml
  23. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-Sec2256AuthorizationManager.xml
  24. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-TypeConversionPathVariables.xml
  25. 3 2
      config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-TypeConversionPathVariablesAuthorizationManager.xml
  26. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-AnonymousDisabled.xml
  27. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-AnonymousEndpoints.xml
  28. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomHttpBasicEntryPointRef.xml
  29. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-NoSecurityForPattern.xml
  30. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-OncePerRequest.xml
  31. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ProtectedLoginPage.xml
  32. 3 2
      config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ProtectedLoginPageAuthorizationManager.xml
  33. 3 2
      config/src/test/resources/org/springframework/security/config/http/MultiHttpBlockConfigTests-DistinctHttpElements.xml
  34. 3 2
      config/src/test/resources/org/springframework/security/config/http/MultiHttpBlockConfigTests-IdenticallyPatternedHttpElements.xml
  35. 4 2
      config/src/test/resources/org/springframework/security/config/http/MultiHttpBlockConfigTests-Sec1937.xml
  36. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolver.xml
  37. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-BasicAndResourceServer.xml
  38. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-FormAndResourceServer.xml
  39. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwkSetUri.xml
  40. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-Jwt.xml
  41. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MultipleIssuers.xml
  42. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueToken.xml
  43. 3 2
      config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndAuthenticationConverter.xml
  44. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-AccessDeniedPage.xml
  45. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-AccessDeniedPageWithSpEL.xml
  46. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-InterceptUrlAndFormLogin.xml
  47. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-InterceptUrlAndFormLoginWithSpEL.xml
  48. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-PortMapping.xml
  49. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-RequiresChannel.xml
  50. 3 2
      config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-UnsecuredPattern.xml
  51. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-DefaultConfig.xml
  52. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-NegativeTokenValidity.xml
  53. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-Sec1827.xml
  54. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-Sec2165.xml
  55. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-Sec742.xml
  56. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-SecureCookie.xml
  57. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-TokenValidity.xml
  58. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithAuthenticationSuccessHandler.xml
  59. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithDataSource.xml
  60. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithRememberMeCookie.xml
  61. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithRememberMeParameter.xml
  62. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithSecurityContextHolderStrategy.xml
  63. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithServicesRef.xml
  64. 3 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithTokenRepository.xml
  65. 4 2
      config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithUserDetailsService.xml
  66. 3 1
      config/src/test/resources/org/springframework/security/config/http/SecurityContextHolderAwareRequestConfigTests-MultiHttp.xml
  67. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-CreateSessionIfRequired.xml
  68. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-CreateSessionNever.xml
  69. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-CreateSessionStateless.xml
  70. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-NoSessionManagementFilter.xml
  71. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-Sec1208.xml
  72. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-Sec2137.xml
  73. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionAuthenticationStrategyRef.xml
  74. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionFixationProtectionMigrateSession.xml
  75. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionFixationProtectionNone.xml
  76. 3 2
      config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionFixationProtectionNoneWithInvalidSessionUrl.xml
  77. 29 0
      config/src/test/resources/org/springframework/security/config/http/handlermappingintrospector.xml
  78. 16 16
      config/src/test/resources/org/springframework/security/util/filtertest-valid.xml
  79. 2 2
      docs/modules/ROOT/pages/servlet/appendix/namespace/http.adoc
  80. 2 0
      docs/modules/ROOT/pages/whats-new.adoc
  81. 18 0
      itest/web/src/integration-test/resources/spring/http-security-concurrency.xml
  82. 20 1
      web/src/main/java/org/springframework/security/web/servlet/util/matcher/MvcRequestMatcher.java

+ 2 - 2
config/src/main/java/org/springframework/security/config/http/AuthorizationFilterParser.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -108,7 +108,7 @@ class AuthorizationFilterParser implements BeanDefinitionParser {
 		if (expressionHandlerRef == null) {
 		if (expressionHandlerRef == null) {
 			expressionHandlerRef = registerDefaultExpressionHandler(parserContext);
 			expressionHandlerRef = registerDefaultExpressionHandler(parserContext);
 		}
 		}
-		MatcherType matcherType = MatcherType.fromElement(element);
+		MatcherType matcherType = MatcherType.fromElementOrMvc(element);
 		ManagedMap<BeanMetadataElement, BeanDefinition> matcherToExpression = new ManagedMap<>();
 		ManagedMap<BeanMetadataElement, BeanDefinition> matcherToExpression = new ManagedMap<>();
 		List<Element> interceptMessages = DomUtils.getChildElementsByTagName(element, Elements.INTERCEPT_URL);
 		List<Element> interceptMessages = DomUtils.getChildElementsByTagName(element, Elements.INTERCEPT_URL);
 		for (Element interceptMessage : interceptMessages) {
 		for (Element interceptMessage : interceptMessages) {

+ 2 - 2
config/src/main/java/org/springframework/security/config/http/FilterChainBeanDefinitionParser.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public class FilterChainBeanDefinitionParser implements BeanDefinitionParser {
 
 
 	@Override
 	@Override
 	public BeanDefinition parse(Element elt, ParserContext pc) {
 	public BeanDefinition parse(Element elt, ParserContext pc) {
-		MatcherType matcherType = MatcherType.fromElement(elt);
+		MatcherType matcherType = MatcherType.fromElementOrMvc(elt);
 		String path = elt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_PATH_PATTERN);
 		String path = elt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_PATH_PATTERN);
 		String requestMatcher = elt.getAttribute(ATT_REQUEST_MATCHER_REF);
 		String requestMatcher = elt.getAttribute(ATT_REQUEST_MATCHER_REF);
 		String filters = elt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_FILTERS);
 		String filters = elt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_FILTERS);

+ 2 - 2
config/src/main/java/org/springframework/security/config/http/FilterChainMapBeanDefinitionDecorator.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class FilterChainMapBeanDefinitionDecorator implements BeanDefinitionDeco
 		BeanDefinition filterChainProxy = holder.getBeanDefinition();
 		BeanDefinition filterChainProxy = holder.getBeanDefinition();
 		ManagedList<BeanMetadataElement> securityFilterChains = new ManagedList<>();
 		ManagedList<BeanMetadataElement> securityFilterChains = new ManagedList<>();
 		Element elt = (Element) node;
 		Element elt = (Element) node;
-		MatcherType matcherType = MatcherType.fromElement(elt);
+		MatcherType matcherType = MatcherType.fromElementOrMvc(elt);
 		List<Element> filterChainElts = DomUtils.getChildElementsByTagName(elt, Elements.FILTER_CHAIN);
 		List<Element> filterChainElts = DomUtils.getChildElementsByTagName(elt, Elements.FILTER_CHAIN);
 		for (Element chain : filterChainElts) {
 		for (Element chain : filterChainElts) {
 			String path = chain.getAttribute(HttpSecurityBeanDefinitionParser.ATT_PATH_PATTERN);
 			String path = chain.getAttribute(HttpSecurityBeanDefinitionParser.ATT_PATH_PATTERN);

+ 1 - 1
config/src/main/java/org/springframework/security/config/http/FilterInvocationSecurityMetadataSourceParser.java

@@ -93,7 +93,7 @@ public class FilterInvocationSecurityMetadataSourceParser implements BeanDefinit
 
 
 	static RootBeanDefinition createSecurityMetadataSource(List<Element> interceptUrls, boolean addAllAuth,
 	static RootBeanDefinition createSecurityMetadataSource(List<Element> interceptUrls, boolean addAllAuth,
 			Element httpElt, ParserContext pc) {
 			Element httpElt, ParserContext pc) {
-		MatcherType matcherType = MatcherType.fromElement(httpElt);
+		MatcherType matcherType = MatcherType.fromElementOrMvc(httpElt);
 		boolean useExpressions = isUseExpressions(httpElt);
 		boolean useExpressions = isUseExpressions(httpElt);
 		ManagedMap<BeanMetadataElement, BeanDefinition> requestToAttributesMap = parseInterceptUrlsForFilterInvocationRequestMap(
 		ManagedMap<BeanMetadataElement, BeanDefinition> requestToAttributesMap = parseInterceptUrlsForFilterInvocationRequestMap(
 				matcherType, interceptUrls, useExpressions, addAllAuth, pc);
 				matcherType, interceptUrls, useExpressions, addAllAuth, pc);

+ 1 - 1
config/src/main/java/org/springframework/security/config/http/HttpConfigurationBuilder.java

@@ -217,7 +217,7 @@ class HttpConfigurationBuilder {
 		this.pc = pc;
 		this.pc = pc;
 		this.portMapper = portMapper;
 		this.portMapper = portMapper;
 		this.portResolver = portResolver;
 		this.portResolver = portResolver;
-		this.matcherType = MatcherType.fromElement(element);
+		this.matcherType = MatcherType.fromElementOrMvc(element);
 		this.interceptUrls = DomUtils.getChildElementsByTagName(element, Elements.INTERCEPT_URL);
 		this.interceptUrls = DomUtils.getChildElementsByTagName(element, Elements.INTERCEPT_URL);
 		validateInterceptUrls(pc);
 		validateInterceptUrls(pc);
 		String createSession = element.getAttribute(ATT_CREATE_SESSION);
 		String createSession = element.getAttribute(ATT_CREATE_SESSION);

+ 2 - 2
config/src/main/java/org/springframework/security/config/http/HttpSecurityBeanDefinitionParser.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2020 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -196,7 +196,7 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
 
 
 		}
 		}
 		else if (StringUtils.hasText(filterChainPattern)) {
 		else if (StringUtils.hasText(filterChainPattern)) {
-			filterChainMatcher = MatcherType.fromElement(element).createMatcher(pc, filterChainPattern, null);
+			filterChainMatcher = MatcherType.fromElementOrMvc(element).createMatcher(pc, filterChainPattern, null);
 		}
 		}
 		else {
 		else {
 			filterChainMatcher = new RootBeanDefinition(AnyRequestMatcher.class);
 			filterChainMatcher = new RootBeanDefinition(AnyRequestMatcher.class);

+ 19 - 3
config/src/main/java/org/springframework/security/config/http/MatcherType.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -22,11 +22,13 @@ import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.http.HttpMethod;
 import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
 import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.security.web.util.matcher.AnyRequestMatcher;
 import org.springframework.security.web.util.matcher.AnyRequestMatcher;
 import org.springframework.security.web.util.matcher.RegexRequestMatcher;
 import org.springframework.security.web.util.matcher.RegexRequestMatcher;
 import org.springframework.security.web.util.matcher.RequestMatcher;
 import org.springframework.security.web.util.matcher.RequestMatcher;
+import org.springframework.util.ClassUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
 
 
 /**
 /**
@@ -40,12 +42,18 @@ public enum MatcherType {
 	ant(AntPathRequestMatcher.class), regex(RegexRequestMatcher.class), ciRegex(RegexRequestMatcher.class), mvc(
 	ant(AntPathRequestMatcher.class), regex(RegexRequestMatcher.class), ciRegex(RegexRequestMatcher.class), mvc(
 			MvcRequestMatcher.class);
 			MvcRequestMatcher.class);
 
 
-	private static final String HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME = "mvcHandlerMappingIntrospector";
+	private static final String HANDLER_MAPPING_INTROSPECTOR = "org.springframework.web.servlet.handler.HandlerMappingIntrospector";
+
+	private static final boolean mvcPresent;
 
 
 	private static final String ATT_MATCHER_TYPE = "request-matcher";
 	private static final String ATT_MATCHER_TYPE = "request-matcher";
 
 
 	final Class<? extends RequestMatcher> type;
 	final Class<? extends RequestMatcher> type;
 
 
+	static {
+		mvcPresent = ClassUtils.isPresent(HANDLER_MAPPING_INTROSPECTOR, MatcherType.class.getClassLoader());
+	}
+
 	MatcherType(Class<? extends RequestMatcher> type) {
 	MatcherType(Class<? extends RequestMatcher> type) {
 		this.type = type;
 		this.type = type;
 	}
 	}
@@ -64,7 +72,7 @@ public enum MatcherType {
 		}
 		}
 		matcherBldr.addConstructorArgValue(path);
 		matcherBldr.addConstructorArgValue(path);
 		if (this == mvc) {
 		if (this == mvc) {
-			matcherBldr.addPropertyValue("method", method);
+			matcherBldr.addPropertyValue("method", (StringUtils.hasText(method) ? HttpMethod.valueOf(method) : null));
 			matcherBldr.addPropertyValue("servletPath", servletPath);
 			matcherBldr.addPropertyValue("servletPath", servletPath);
 		}
 		}
 		else {
 		else {
@@ -84,4 +92,12 @@ public enum MatcherType {
 		return ant;
 		return ant;
 	}
 	}
 
 
+	static MatcherType fromElementOrMvc(Element elt) {
+		String matcherTypeName = elt.getAttribute(ATT_MATCHER_TYPE);
+		if (!StringUtils.hasText(matcherTypeName) && mvcPresent) {
+			return MatcherType.mvc;
+		}
+		return MatcherType.fromElement(elt);
+	}
+
 }
 }

+ 7 - 5
config/src/test/java/org/springframework/security/config/FilterChainProxyConfigTests.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -36,8 +36,9 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
 import org.springframework.security.web.context.SecurityContextPersistenceFilter;
 import org.springframework.security.web.context.SecurityContextPersistenceFilter;
 import org.springframework.security.web.firewall.DefaultHttpFirewall;
 import org.springframework.security.web.firewall.DefaultHttpFirewall;
 import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter;
 import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter;
-import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.security.web.util.matcher.AnyRequestMatcher;
 import org.springframework.security.web.util.matcher.AnyRequestMatcher;
+import org.springframework.security.web.util.matcher.RequestMatcher;
+import org.springframework.test.util.ReflectionTestUtils;
 
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.any;
@@ -113,12 +114,13 @@ public class FilterChainProxyConfigTests {
 		List<SecurityFilterChain> chains = fcp.getFilterChains();
 		List<SecurityFilterChain> chains = fcp.getFilterChains();
 		assertThat(getPattern(chains.get(0))).isEqualTo("/login*");
 		assertThat(getPattern(chains.get(0))).isEqualTo("/login*");
 		assertThat(getPattern(chains.get(1))).isEqualTo("/logout");
 		assertThat(getPattern(chains.get(1))).isEqualTo("/logout");
-		assertThat(((DefaultSecurityFilterChain) chains.get(2)).getRequestMatcher() instanceof AnyRequestMatcher)
-				.isTrue();
+		assertThat(((DefaultSecurityFilterChain) chains.get(2)).getRequestMatcher())
+				.isInstanceOf(AnyRequestMatcher.class);
 	}
 	}
 
 
 	private String getPattern(SecurityFilterChain chain) {
 	private String getPattern(SecurityFilterChain chain) {
-		return ((AntPathRequestMatcher) ((DefaultSecurityFilterChain) chain).getRequestMatcher()).getPattern();
+		RequestMatcher requestMatcher = ((DefaultSecurityFilterChain) chain).getRequestMatcher();
+		return (String) ReflectionTestUtils.getField(requestMatcher, "pattern");
 	}
 	}
 
 
 	private void checkPathAndFilterOrder(FilterChainProxy filterChainProxy) {
 	private void checkPathAndFilterOrder(FilterChainProxy filterChainProxy) {

+ 10 - 8
config/src/test/java/org/springframework/security/config/http/FilterSecurityMetadataSourceBeanDefinitionParserTests.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -92,10 +92,12 @@ public class FilterSecurityMetadataSourceBeanDefinitionParserTests {
 	public void interceptUrlsSupportPropertyPlaceholders() {
 	public void interceptUrlsSupportPropertyPlaceholders() {
 		System.setProperty("secure.url", "/secure");
 		System.setProperty("secure.url", "/secure");
 		System.setProperty("secure.role", "ROLE_A");
 		System.setProperty("secure.role", "ROLE_A");
-		setContext("<b:bean class='org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'/>"
-				+ "<filter-security-metadata-source id='fids' use-expressions='false'>"
-				+ "   <intercept-url pattern='${secure.url}' access='${secure.role}'/>"
-				+ "</filter-security-metadata-source>");
+		setContext(
+				"<b:bean class=\"org.springframework.web.servlet.handler.HandlerMappingIntrospector\" name=\"mvcHandlerMappingIntrospector\"/>"
+						+ "<b:bean class='org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'/>"
+						+ "<filter-security-metadata-source id='fids' use-expressions='false'>"
+						+ "   <intercept-url pattern='${secure.url}' access='${secure.role}'/>"
+						+ "</filter-security-metadata-source>");
 		DefaultFilterInvocationSecurityMetadataSource fids = (DefaultFilterInvocationSecurityMetadataSource) this.appContext
 		DefaultFilterInvocationSecurityMetadataSource fids = (DefaultFilterInvocationSecurityMetadataSource) this.appContext
 				.getBean("fids");
 				.getBean("fids");
 		Collection<ConfigAttribute> cad = fids.getAttributes(createFilterInvocation("/secure", "GET"));
 		Collection<ConfigAttribute> cad = fids.getAttributes(createFilterInvocation("/secure", "GET"));
@@ -105,7 +107,8 @@ public class FilterSecurityMetadataSourceBeanDefinitionParserTests {
 	@Test
 	@Test
 	public void parsingWithinFilterSecurityInterceptorIsSuccessful() {
 	public void parsingWithinFilterSecurityInterceptorIsSuccessful() {
 		// @formatter:off
 		// @formatter:off
-		setContext("<http auto-config='true' use-expressions='false'/>"
+		setContext("<b:bean class=\"org.springframework.web.servlet.handler.HandlerMappingIntrospector\" name=\"mvcHandlerMappingIntrospector\"/>" +
+				"<http auto-config='true' use-expressions='false'/>"
 				+ "<b:bean id='fsi' class='org.springframework.security.web.access.intercept.FilterSecurityInterceptor' autowire='byType'>"
 				+ "<b:bean id='fsi' class='org.springframework.security.web.access.intercept.FilterSecurityInterceptor' autowire='byType'>"
 				+ "   <b:property name='securityMetadataSource'>"
 				+ "   <b:property name='securityMetadataSource'>"
 				+ "       <filter-security-metadata-source use-expressions='false'>"
 				+ "       <filter-security-metadata-source use-expressions='false'>"
@@ -130,9 +133,8 @@ public class FilterSecurityMetadataSourceBeanDefinitionParserTests {
 
 
 	private FilterInvocation createFilterInvocation(String path, String method) {
 	private FilterInvocation createFilterInvocation(String path, String method) {
 		MockHttpServletRequest request = new MockHttpServletRequest("GET", "");
 		MockHttpServletRequest request = new MockHttpServletRequest("GET", "");
-		request.setRequestURI(null);
+		request.setRequestURI(path);
 		request.setMethod(method);
 		request.setMethod(method);
-		request.setServletPath(path);
 		return new FilterInvocation(request, new MockHttpServletResponse(), new MockFilterChain());
 		return new FilterInvocation(request, new MockHttpServletResponse(), new MockFilterChain());
 	}
 	}
 
 

+ 13 - 5
config/src/test/java/org/springframework/security/config/http/InterceptUrlConfigTests.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2018 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.stubbing.Answer;
 import org.mockito.stubbing.Answer;
 
 
+import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
 import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
 import org.springframework.mock.web.MockServletContext;
 import org.springframework.mock.web.MockServletContext;
@@ -39,6 +40,7 @@ import org.springframework.web.context.ConfigurableWebApplicationContext;
 
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
 import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.assertj.core.api.Assertions.assertThatNoException;
 import static org.mockito.BDDMockito.given;
 import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.spy;
@@ -361,14 +363,20 @@ public class InterceptUrlConfigTests {
 	}
 	}
 
 
 	@Test
 	@Test
-	public void configureWhenUsingDefaultMatcherAndServletPathThenThrowsException() {
-		assertThatExceptionOfType(BeanDefinitionParsingException.class)
+	public void configureWhenUsingDefaultMatcherAndServletPathThenNoException() {
+		assertThatNoException()
 				.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultMatcherServletPath")).autowire());
 				.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultMatcherServletPath")).autowire());
 	}
 	}
 
 
 	@Test
 	@Test
-	public void configureWhenUsingDefaultMatcherAndServletPathAndAuthorizationManagerThenThrowsException() {
-		assertThatExceptionOfType(BeanDefinitionParsingException.class).isThrownBy(() -> this.spring
+	public void configureWhenUsingDefaultMatcherAndNoIntrospectorBeanThenException() {
+		assertThatExceptionOfType(BeanCreationException.class)
+				.isThrownBy(() -> this.spring.configLocations(this.xml("DefaultMatcherNoIntrospectorBean")).autowire());
+	}
+
+	@Test
+	public void configureWhenUsingDefaultMatcherAndServletPathAndAuthorizationManagerThenNoException() {
+		assertThatNoException().isThrownBy(() -> this.spring
 				.configLocations(this.xml("DefaultMatcherServletPathAuthorizationManager")).autowire());
 				.configLocations(this.xml("DefaultMatcherServletPathAuthorizationManager")).autowire());
 	}
 	}
 
 

+ 18 - 0
config/src/test/resources/org/springframework/security/config/http/CsrfBeanDefinitionParserTests-RegisterDataValueProcessorOnyIfNotRegistered.xml

@@ -1,3 +1,19 @@
+<!--
+  ~ Copyright 2002-2022 the original author or authors.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      https://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	   xmlns:context="http://www.springframework.org/schema/context"
 	   xmlns:context="http://www.springframework.org/schema/context"
 	   xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
 	   xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
@@ -27,5 +43,7 @@ http://www.springframework.org/schema/security https://www.springframework.org/s
 			</security:user-service>
 			</security:user-service>
 		</security:authentication-provider>
 		</security:authentication-provider>
 	</security:authentication-manager>
 	</security:authentication-manager>
+	
+	<import resource="handlermappingintrospector.xml"/>
 
 
 </beans>
 </beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/CsrfConfigTests-CsrfEnabled.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,6 +29,7 @@
 	</http>
 	</http>
 
 
 	<b:import resource="CsrfConfigTests-shared-userservice.xml"/>
 	<b:import resource="CsrfConfigTests-shared-userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 
 
 	<b:bean id="firewall" class="org.springframework.security.web.firewall.StrictHttpFirewall"
 	<b:bean id="firewall" class="org.springframework.security.web.firewall.StrictHttpFirewall"
 			p:unsafeAllowAnyHttpMethod="true"/>
 			p:unsafeAllowAnyHttpMethod="true"/>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-CamelCasePathVariables.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-CamelCasePathVariablesAuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 33 - 0
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-DefaultMatcherNoIntrospectorBean.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2002-2022 the original author or authors.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      https://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<b:beans xmlns:b="http://www.springframework.org/schema/beans"
+		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		xmlns="http://www.springframework.org/schema/security"
+		xsi:schemaLocation="
+			http://www.springframework.org/schema/security
+			https://www.springframework.org/schema/security/spring-security.xsd
+			http://www.springframework.org/schema/beans
+			https://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<http>
+		<intercept-url pattern="/path" access="denyAll" servlet-path="/spring"/>
+		<http-basic/>
+	</http>
+
+	<b:import resource="userservice.xml"/>
+</b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-DefaultMatcherServletPath.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-DefaultMatcherServletPathAuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PatchMethod.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PatchMethodAuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PathVariables.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-PathVariablesAuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-Sec2256.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-Sec2256AuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 	<b:bean name="path" class="org.springframework.security.config.http.InterceptUrlConfigTests.PathController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-TypeConversionPathVariables.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	<b:bean name="id" class="org.springframework.security.config.http.InterceptUrlConfigTests.Id"/>
 	<b:bean name="id" class="org.springframework.security.config.http.InterceptUrlConfigTests.Id"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/InterceptUrlConfigTests-TypeConversionPathVariablesAuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	<b:bean name="id" class="org.springframework.security.config.http.InterceptUrlConfigTests.Id"/>
 	<b:bean name="id" class="org.springframework.security.config.http.InterceptUrlConfigTests.Id"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-AnonymousDisabled.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,4 +32,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-AnonymousEndpoints.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,4 +31,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-CustomHttpBasicEntryPointRef.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	</b:bean>
 	</b:bean>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-NoSecurityForPattern.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,4 +29,5 @@
 	<http pattern="/unprotected" security="none"/>
 	<http pattern="/unprotected" security="none"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-OncePerRequest.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,4 +31,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ProtectedLoginPage.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MiscHttpConfigTests-ProtectedLoginPageAuthorizationManager.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MultiHttpBlockConfigTests-DistinctHttpElements.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="basicController" class="org.springframework.security.config.http.MultiHttpBlockConfigTests.BasicController"/>
 	<b:bean name="basicController" class="org.springframework.security.config.http.MultiHttpBlockConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/MultiHttpBlockConfigTests-IdenticallyPatternedHttpElements.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,4 +31,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 4 - 2
config/src/test/resources/org/springframework/security/config/http/MultiHttpBlockConfigTests-Sec1937.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -47,4 +47,6 @@
 			</user-service>
 			</user-service>
 		</authentication-provider>
 		</authentication-provider>
 	</authentication-manager>
 	</authentication-manager>
+	
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-AuthenticationManagerResolver.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,4 +32,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-BasicAndResourceServer.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-FormAndResourceServer.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-JwkSetUri.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-Jwt.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,4 +32,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-MultipleIssuers.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,4 +38,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueToken.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/OAuth2ResourceServerBeanDefinitionParserTests-OpaqueTokenAndAuthenticationConverter.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2020 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,4 +35,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-AccessDeniedPage.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-AccessDeniedPageWithSpEL.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-InterceptUrlAndFormLogin.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -39,4 +39,5 @@
 	<b:bean name="unsecured" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="unsecured" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-InterceptUrlAndFormLoginWithSpEL.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -42,4 +42,5 @@
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-PortMapping.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,4 +38,5 @@
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-RequiresChannel.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="sc" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/PlaceHolderAndELConfigTests-UnsecuredPattern.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,4 +35,5 @@
 	<b:bean name="unsecured" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 	<b:bean name="unsecured" class="org.springframework.security.config.http.PlaceHolderAndELConfigTests.SimpleController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-DefaultConfig.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-NegativeTokenValidity.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,4 +36,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-Sec1827.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,4 +36,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-Sec2165.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,4 +36,5 @@
 	</b:bean>
 	</b:bean>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-Sec742.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,4 +37,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-SecureCookie.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,4 +36,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-TokenValidity.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,4 +36,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithAuthenticationSuccessHandler.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -43,4 +43,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithDataSource.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,4 +38,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithRememberMeCookie.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@
 	</http>
 	</http>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithRememberMeParameter.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithSecurityContextHolderStrategy.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -40,4 +40,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithServicesRef.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -44,4 +44,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithTokenRepository.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -48,4 +48,5 @@
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 4 - 2
config/src/test/resources/org/springframework/security/config/http/RememberMeConfigTests-WithUserDetailsService.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -40,4 +40,6 @@
 	<b:bean
 	<b:bean
 		name="basicController"
 		name="basicController"
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
 		class="org.springframework.security.config.http.RememberMeConfigTests.BasicController"/>
+	
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 1
config/src/test/resources/org/springframework/security/config/http/SecurityContextHolderAwareRequestConfigTests-MultiHttp.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
@@ -53,4 +53,6 @@
 			</user-service>
 			</user-service>
 		</authentication-provider>
 		</authentication-provider>
 	</authentication-manager>
 	</authentication-manager>
+	
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-CreateSessionIfRequired.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,4 +32,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-CreateSessionNever.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,4 +32,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-CreateSessionStateless.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,4 +32,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-NoSessionManagementFilter.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-Sec1208.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,4 +37,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-Sec2137.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,4 +35,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionAuthenticationStrategyRef.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,4 +38,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.TeapotSessionAuthenticationStrategy"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.TeapotSessionAuthenticationStrategy"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionFixationProtectionMigrateSession.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,4 +35,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionFixationProtectionNone.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 3 - 2
config/src/test/resources/org/springframework/security/config/http/SessionManagementConfigTests-SessionFixationProtectionNoneWithInvalidSessionUrl.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 <!--
-  ~ Copyright 2002-2018 the original author or authors.
+  ~ Copyright 2002-2022 the original author or authors.
   ~
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
   ~ you may not use this file except in compliance with the License.
   ~ You may obtain a copy of the License at
   ~ You may obtain a copy of the License at
   ~
   ~
-  ~       https://www.apache.org/licenses/LICENSE-2.0
+  ~      https://www.apache.org/licenses/LICENSE-2.0
   ~
   ~
   ~ Unless required by applicable law or agreed to in writing, software
   ~ Unless required by applicable law or agreed to in writing, software
   ~ distributed under the License is distributed on an "AS IS" BASIS,
   ~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 			class="org.springframework.security.config.http.SessionManagementConfigTests.BasicController"/>
 
 
 	<b:import resource="userservice.xml"/>
 	<b:import resource="userservice.xml"/>
+	<b:import resource="handlermappingintrospector.xml"/>
 </b:beans>
 </b:beans>

+ 29 - 0
config/src/test/resources/org/springframework/security/config/http/handlermappingintrospector.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2002-2022 the original author or authors.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      https://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<b:beans xmlns:b="http://www.springframework.org/schema/beans"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xmlns="http://www.springframework.org/schema/security"
+		 xsi:schemaLocation="
+			http://www.springframework.org/schema/security
+			https://www.springframework.org/schema/security/spring-security.xsd
+			http://www.springframework.org/schema/beans
+			https://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<b:bean class="org.springframework.web.servlet.handler.HandlerMappingIntrospector" name="mvcHandlerMappingIntrospector"/>
+
+</b:beans>

+ 16 - 16
config/src/test/resources/org/springframework/security/util/filtertest-valid.xml

@@ -1,22 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 
 
 <!--
 <!--
- * Copyright 2004 Acegi Technology Pty Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *	   https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
--->
+  ~ Copyright 2002-2022 the original author or authors.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      https://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
 <beans default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans"
 <beans default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans"
 	xmlns:sec="http://www.springframework.org/schema/security"
 	xmlns:sec="http://www.springframework.org/schema/security"
 	xmlns:util="http://www.springframework.org/schema/util"
 	xmlns:util="http://www.springframework.org/schema/util"
@@ -176,5 +174,7 @@
 			</list>
 			</list>
 		</constructor-arg>
 		</constructor-arg>
 	</bean>
 	</bean>
+	
+	<bean class="org.springframework.web.servlet.handler.HandlerMappingIntrospector" name="mvcHandlerMappingIntrospector"/>
 
 
 </beans>
 </beans>

+ 2 - 2
docs/modules/ROOT/pages/servlet/appendix/namespace/http.adoc

@@ -117,7 +117,7 @@ Options are currently `mvc`, `ant`, `regex` and `ciRegex`, for Spring MVC, ant,
 A separate instance is created for each <<nsa-intercept-url,intercept-url>> element using its <<nsa-intercept-url-pattern,pattern>>, <<nsa-intercept-url-method,method>> and <<nsa-intercept-url-servlet-path,servlet-path>> attributes.
 A separate instance is created for each <<nsa-intercept-url,intercept-url>> element using its <<nsa-intercept-url-pattern,pattern>>, <<nsa-intercept-url-method,method>> and <<nsa-intercept-url-servlet-path,servlet-path>> attributes.
 Ant paths are matched using an `AntPathRequestMatcher`, regular expressions are matched using a `RegexRequestMatcher` and for Spring MVC path matching the `MvcRequestMatcher` is used.
 Ant paths are matched using an `AntPathRequestMatcher`, regular expressions are matched using a `RegexRequestMatcher` and for Spring MVC path matching the `MvcRequestMatcher` is used.
 See the Javadoc for these classes for more details on exactly how the matching is performed.
 See the Javadoc for these classes for more details on exactly how the matching is performed.
-Ant paths are the default strategy.
+MVC is the default strategy if Spring MVC is present in the classpath, if not, Ant paths are used.
 
 
 
 
 [[nsa-http-request-matcher-ref]]
 [[nsa-http-request-matcher-ref]]
@@ -1653,7 +1653,7 @@ If an identical pattern is specified with and without a method, the method-speci
 [[nsa-intercept-url-pattern]]
 [[nsa-intercept-url-pattern]]
 * **pattern**
 * **pattern**
 The pattern which defines the URL path.
 The pattern which defines the URL path.
-The content will depend on the `request-matcher` attribute from the containing http element, so will default to ant path syntax.
+The content will depend on the `request-matcher` attribute from the containing http element, so will default to MVC matcher if Spring MVC is in the classpath.
 
 
 
 
 [[nsa-intercept-url-request-matcher-ref]]
 [[nsa-intercept-url-request-matcher-ref]]

+ 2 - 0
docs/modules/ROOT/pages/whats-new.adoc

@@ -20,3 +20,5 @@ Reorganize imports
 * https://github.com/spring-projects/spring-security/issues/10347[gh-10347] - Remove `UsernamePasswordAuthenticationToken` check in `BasicAuthenticationFilter`
 * https://github.com/spring-projects/spring-security/issues/10347[gh-10347] - Remove `UsernamePasswordAuthenticationToken` check in `BasicAuthenticationFilter`
 * https://github.com/spring-projects/spring-security/pull/11923[gh-11923] - Remove `WebSecurityConfigurerAdapter`.
 * https://github.com/spring-projects/spring-security/pull/11923[gh-11923] - Remove `WebSecurityConfigurerAdapter`.
 Instead, create a https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter[SecurityFilterChain bean].
 Instead, create a https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter[SecurityFilterChain bean].
+* https://github.com/spring-projects/spring-security/issues/11899[gh-11899] - Use `MvcRequestMatcher` by default if Spring MVC is present.
+You can configure a different `RequestMatcher` by using the https://docs.spring.io/spring-security/reference/servlet/appendix/namespace/http.html#nsa-http-attributes[request-matcher attribute from <http>].

+ 18 - 0
itest/web/src/integration-test/resources/spring/http-security-concurrency.xml

@@ -1,5 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 
 
+<!--
+  ~ Copyright 2002-2022 the original author or authors.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      https://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
 <beans:beans xmlns="http://www.springframework.org/schema/security"
 <beans:beans xmlns="http://www.springframework.org/schema/security"
 	xmlns:beans="http://www.springframework.org/schema/beans"
 	xmlns:beans="http://www.springframework.org/schema/beans"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -31,4 +47,6 @@
 		<csrf disabled="true"/>
 		<csrf disabled="true"/>
 	</http>
 	</http>
 
 
+	<beans:bean class="org.springframework.web.servlet.handler.HandlerMappingIntrospector" name="mvcHandlerMappingIntrospector"/>
+
 </beans:beans>
 </beans:beans>

+ 20 - 1
web/src/main/java/org/springframework/security/web/servlet/util/matcher/MvcRequestMatcher.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2012-2022 the original author or authors.
+ * Copyright 2002-2022 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 package org.springframework.security.web.servlet.util.matcher;
 package org.springframework.security.web.servlet.util.matcher;
 
 
 import java.util.Map;
 import java.util.Map;
+import java.util.Objects;
 
 
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletRequest;
 
 
@@ -129,6 +130,24 @@ public class MvcRequestMatcher implements RequestMatcher, RequestVariablesExtrac
 		return this.servletPath;
 		return this.servletPath;
 	}
 	}
 
 
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) {
+			return true;
+		}
+		if (o == null || getClass() != o.getClass()) {
+			return false;
+		}
+		MvcRequestMatcher that = (MvcRequestMatcher) o;
+		return Objects.equals(this.pattern, that.pattern) && Objects.equals(this.method, that.method)
+				&& Objects.equals(this.servletPath, that.servletPath);
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.pattern, this.method, this.servletPath);
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		StringBuilder sb = new StringBuilder();
 		StringBuilder sb = new StringBuilder();