From ff73a4d0bba018959b02238d9fa8d886c20c6eb3 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 5 Jun 2025 12:46:50 +0100 Subject: [PATCH] Move Servlet Filters into spring-boot-servlet Closes gh-46151 --- .../web/servlet/FilterOrderingIntegrationTests.java | 4 ++-- spring-boot-project/spring-boot-freemarker/build.gradle | 1 + .../FreeMarkerAutoConfigurationServletIntegrationTests.java | 2 +- .../boot/security/autoconfigure/SecurityProperties.java | 2 +- .../servlet/SecurityAutoConfigurationTests.java | 2 +- .../ServletManagementContextAutoConfiguration.java | 2 +- .../autoconfigure/HttpEncodingAutoConfiguration.java | 2 +- .../servlet/filter/ApplicationContextHeaderFilter.java | 4 ++-- .../servlet/filter/OrderedCharacterEncodingFilter.java | 4 ++-- .../springframework/boot}/servlet/filter/OrderedFilter.java | 4 ++-- .../boot}/servlet/filter/OrderedFormContentFilter.java | 4 ++-- .../boot}/servlet/filter/OrderedHiddenHttpMethodFilter.java | 4 ++-- .../boot}/servlet/filter/OrderedRequestContextFilter.java | 4 ++-- .../springframework/boot}/servlet/filter/package-info.java | 2 +- .../autoconfigure/HttpEncodingAutoConfigurationTests.java | 4 ++-- .../ThymeleafServletAutoConfigurationTests.java | 2 +- .../web/WebMvcEndpointChildContextConfiguration.java | 2 +- .../boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java | 6 +++--- .../web/WebMvcEndpointChildContextConfigurationTests.java | 2 +- .../webmvc/autoconfigure/WebMvcAutoConfigurationTests.java | 2 +- 20 files changed, 30 insertions(+), 29 deletions(-) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/ApplicationContextHeaderFilter.java (96%) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/OrderedCharacterEncodingFilter.java (94%) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/OrderedFilter.java (93%) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/OrderedFormContentFilter.java (95%) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/OrderedHiddenHttpMethodFilter.java (95%) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/OrderedRequestContextFilter.java (94%) rename spring-boot-project/{spring-boot/src/main/java/org/springframework/boot/web => spring-boot-servlet/src/main/java/org/springframework/boot}/servlet/filter/package-info.java (93%) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java index de93744e0a1..9beb8ab5a62 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java @@ -27,14 +27,14 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration; import org.springframework.boot.servlet.autoconfigure.HttpEncodingAutoConfiguration; +import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter; +import org.springframework.boot.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; import org.springframework.boot.web.server.servlet.MockServletWebServer.RegisteredFilter; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; -import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-freemarker/build.gradle b/spring-boot-project/spring-boot-freemarker/build.gradle index 3d38b012d45..12e5ffd119e 100644 --- a/spring-boot-project/spring-boot-freemarker/build.gradle +++ b/spring-boot-project/spring-boot-freemarker/build.gradle @@ -35,6 +35,7 @@ dependencies { optional("org.springframework:spring-webflux") optional("jakarta.servlet:jakarta.servlet-api") + testImplementation(project(":spring-boot-project:spring-boot-servlet")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) diff --git a/spring-boot-project/spring-boot-freemarker/src/test/java/org/springframework/boot/freemarker/autoconfigure/FreeMarkerAutoConfigurationServletIntegrationTests.java b/spring-boot-project/spring-boot-freemarker/src/test/java/org/springframework/boot/freemarker/autoconfigure/FreeMarkerAutoConfigurationServletIntegrationTests.java index 8ffc6032967..05090abcfa1 100644 --- a/spring-boot-project/spring-boot-freemarker/src/test/java/org/springframework/boot/freemarker/autoconfigure/FreeMarkerAutoConfigurationServletIntegrationTests.java +++ b/spring-boot-project/spring-boot-freemarker/src/test/java/org/springframework/boot/freemarker/autoconfigure/FreeMarkerAutoConfigurationServletIntegrationTests.java @@ -28,11 +28,11 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; +import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java index 3b973c51b3a..5010b4c9297 100644 --- a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java +++ b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java @@ -23,8 +23,8 @@ import java.util.Set; import java.util.UUID; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.servlet.filter.OrderedFilter; import org.springframework.boot.web.servlet.DispatcherType; -import org.springframework.boot.web.servlet.filter.OrderedFilter; import org.springframework.core.Ordered; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityAutoConfigurationTests.java index 0ae85a87b10..a18c9e840d0 100644 --- a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityAutoConfigurationTests.java @@ -37,11 +37,11 @@ import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration; import org.springframework.boot.security.autoconfigure.jpa.City; +import org.springframework.boot.servlet.filter.OrderedFilter; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean; -import org.springframework.boot.web.servlet.filter.OrderedFilter; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/actuate/autoconfigure/ServletManagementContextAutoConfiguration.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/actuate/autoconfigure/ServletManagementContextAutoConfiguration.java index 1423575302d..511189840ea 100644 --- a/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/actuate/autoconfigure/ServletManagementContextAutoConfiguration.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/actuate/autoconfigure/ServletManagementContextAutoConfiguration.java @@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.servlet.filter.ApplicationContextHeaderFilter; +import org.springframework.boot.servlet.filter.ApplicationContextHeaderFilter; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfiguration.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfiguration.java index e1f40f6f795..3c79d8f940d 100644 --- a/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfiguration.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfiguration.java @@ -23,7 +23,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; +import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.context.annotation.Bean; import org.springframework.web.filter.CharacterEncodingFilter; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/ApplicationContextHeaderFilter.java similarity index 96% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/ApplicationContextHeaderFilter.java index da58d911b4b..a4f899fdf69 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/ApplicationContextHeaderFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; import java.io.IOException; @@ -32,7 +32,7 @@ import org.springframework.web.filter.OncePerRequestFilter; * * @author Phillip Webb * @author Venil Noronha - * @since 2.0.0 + * @since 4.0.0 */ public class ApplicationContextHeaderFilter extends OncePerRequestFilter { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedCharacterEncodingFilter.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedCharacterEncodingFilter.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedCharacterEncodingFilter.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedCharacterEncodingFilter.java index ddf29c1b908..7dfb4000b87 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedCharacterEncodingFilter.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedCharacterEncodingFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; import org.springframework.core.Ordered; import org.springframework.web.filter.CharacterEncodingFilter; @@ -23,7 +23,7 @@ import org.springframework.web.filter.CharacterEncodingFilter; * {@link CharacterEncodingFilter} that also implements {@link Ordered}. * * @author Phillip Webb - * @since 2.0.0 + * @since 4.0.0 */ public class OrderedCharacterEncodingFilter extends CharacterEncodingFilter implements OrderedFilter { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedFilter.java similarity index 93% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedFilter.java index ef1b3d0f5eb..d556d007cd8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFilter.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; import jakarta.servlet.Filter; @@ -24,7 +24,7 @@ import org.springframework.core.Ordered; * An {@link Ordered} {@link jakarta.servlet.Filter}. * * @author Phillip Webb - * @since 2.1.0 + * @since 4.0.0 */ public interface OrderedFilter extends Filter, Ordered { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFormContentFilter.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedFormContentFilter.java similarity index 95% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFormContentFilter.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedFormContentFilter.java index c285a64a9ff..6db5b237180 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedFormContentFilter.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedFormContentFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; import org.springframework.core.Ordered; import org.springframework.web.filter.FormContentFilter; @@ -24,7 +24,7 @@ import org.springframework.web.filter.FormContentFilter; * * @author Joao Pedro Evangelista * @author Brian Clozel - * @since 2.1.0 + * @since 4.0.0 */ public class OrderedFormContentFilter extends FormContentFilter implements OrderedFilter { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedHiddenHttpMethodFilter.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedHiddenHttpMethodFilter.java similarity index 95% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedHiddenHttpMethodFilter.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedHiddenHttpMethodFilter.java index 428c816a01f..08dbbbb70ab 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedHiddenHttpMethodFilter.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedHiddenHttpMethodFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; import org.springframework.core.Ordered; import org.springframework.web.filter.HiddenHttpMethodFilter; @@ -23,7 +23,7 @@ import org.springframework.web.filter.HiddenHttpMethodFilter; * {@link HiddenHttpMethodFilter} that also implements {@link Ordered}. * * @author Phillip Webb - * @since 2.0.0 + * @since 4.0.0 */ public class OrderedHiddenHttpMethodFilter extends HiddenHttpMethodFilter implements OrderedFilter { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedRequestContextFilter.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedRequestContextFilter.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedRequestContextFilter.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedRequestContextFilter.java index c9c02205a9b..17a677b861d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/OrderedRequestContextFilter.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/OrderedRequestContextFilter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; import org.springframework.core.Ordered; import org.springframework.web.filter.RequestContextFilter; @@ -23,7 +23,7 @@ import org.springframework.web.filter.RequestContextFilter; * {@link RequestContextFilter} that also implements {@link Ordered}. * * @author Phillip Webb - * @since 2.0.0 + * @since 4.0.0 */ public class OrderedRequestContextFilter extends RequestContextFilter implements OrderedFilter { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/package-info.java similarity index 93% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java rename to spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/package-info.java index a6059020d89..c7c2b1ac032 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/package-info.java +++ b/spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/filter/package-info.java @@ -17,4 +17,4 @@ /** * Spring Boot specific {@link jakarta.servlet.Filter} implementations. */ -package org.springframework.boot.web.servlet.filter; +package org.springframework.boot.servlet.filter; diff --git a/spring-boot-project/spring-boot-servlet/src/test/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfigurationTests.java b/spring-boot-project/spring-boot-servlet/src/test/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfigurationTests.java index f3e0c4687eb..0aec3b4258b 100644 --- a/spring-boot-project/spring-boot-servlet/src/test/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-servlet/src/test/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfigurationTests.java @@ -24,10 +24,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.boot.servlet.filter.OrderedFormContentFilter; +import org.springframework.boot.servlet.filter.OrderedHiddenHttpMethodFilter; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; -import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter; -import org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationAwareOrderComparator; diff --git a/spring-boot-project/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java b/spring-boot-project/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java index a678b5162c1..7652afef788 100644 --- a/spring-boot-project/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java @@ -44,6 +44,7 @@ import org.thymeleaf.templateresolver.ITemplateResolver; import org.thymeleaf.web.servlet.JakartaServletWebApplication; import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; @@ -51,7 +52,6 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.mock.web.MockHttpServletRequest; diff --git a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfiguration.java b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfiguration.java index 5544811dd42..4fef1b63184 100644 --- a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfiguration.java @@ -24,11 +24,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; +import org.springframework.boot.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.server.autoconfigure.ServerProperties; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; -import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletRegistrationBean; import org.springframework.boot.webmvc.error.ErrorAttributes; diff --git a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java index c425418415b..6624e84fe35 100644 --- a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java @@ -52,11 +52,11 @@ import org.springframework.boot.autoconfigure.web.format.WebConversionService; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.boot.http.converter.autoconfigure.HttpMessageConverters; +import org.springframework.boot.servlet.filter.OrderedFormContentFilter; +import org.springframework.boot.servlet.filter.OrderedHiddenHttpMethodFilter; +import org.springframework.boot.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.validation.autoconfigure.ValidatorAdapter; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter; -import org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter; -import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties.Format; import org.springframework.context.ApplicationContext; import org.springframework.context.ResourceLoaderAware; diff --git a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfigurationTests.java b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfigurationTests.java index 5c4e942b9c2..ad59a419b48 100644 --- a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfigurationTests.java +++ b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfigurationTests.java @@ -18,8 +18,8 @@ package org.springframework.boot.webmvc.actuate.autoconfigure.web; import org.junit.jupiter.api.Test; +import org.springframework.boot.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java index 065aeaa3481..619d01b10c2 100644 --- a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java @@ -48,6 +48,7 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; import org.springframework.boot.http.converter.autoconfigure.HttpMessageConverters; import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration; +import org.springframework.boot.servlet.filter.OrderedFormContentFilter; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; @@ -61,7 +62,6 @@ import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.LowestOrderedControllerAdvice;