From 5f33bbe512c082109e73bc16c1261bd434fe3790 Mon Sep 17 00:00:00 2001 From: Farooq Khan Date: Thu, 3 Jan 2019 10:34:56 +0500 Subject: [PATCH] Removed isServlet30 check --- .../annotation/web/AbstractRequestMatcherRegistry.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java index f9d9c5efe0..c8923f7ef4 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java @@ -25,7 +25,6 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.AnyRequestMatcher; import org.springframework.security.web.util.matcher.RegexRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; -import org.springframework.util.ClassUtils; import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import java.util.ArrayList; @@ -161,7 +160,7 @@ public abstract class AbstractRequestMatcherRegistry { */ protected final List createMvcMatchers(HttpMethod method, String... mvcPatterns) { - boolean isServlet30 = ClassUtils.isPresent("javax.servlet.ServletRegistration", getClass().getClassLoader()); + ObjectPostProcessor opp = this.context.getBean(ObjectPostProcessor.class); if (!this.context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) { throw new NoSuchBeanDefinitionException("A Bean named " + HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME +" of type " + HandlerMappingIntrospector.class.getName() @@ -173,9 +172,8 @@ public abstract class AbstractRequestMatcherRegistry { mvcPatterns.length); for (String mvcPattern : mvcPatterns) { MvcRequestMatcher matcher = new MvcRequestMatcher(introspector, mvcPattern); - if (isServlet30) { - opp.postProcess(matcher); - } + opp.postProcess(matcher); + if (method != null) { matcher.setMethod(method); }