Skip to content

Commit b58c326

Browse files
committed
Move Servlet Filters into spring-boot-servlet
1 parent e606818 commit b58c326

File tree

20 files changed

+37
-36
lines changed

20 files changed

+37
-36
lines changed

spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
2828
import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration;
2929
import org.springframework.boot.servlet.autoconfigure.HttpEncodingAutoConfiguration;
30+
import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter;
31+
import org.springframework.boot.servlet.filter.OrderedRequestContextFilter;
3032
import org.springframework.boot.session.autoconfigure.SessionAutoConfiguration;
3133
import org.springframework.boot.test.util.TestPropertyValues;
3234
import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor;
3335
import org.springframework.boot.web.server.servlet.MockServletWebServer.RegisteredFilter;
3436
import org.springframework.boot.web.server.servlet.MockServletWebServerFactory;
3537
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
36-
import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter;
37-
import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
3838
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
3939
import org.springframework.context.annotation.Bean;
4040
import org.springframework.context.annotation.Configuration;

spring-boot-project/spring-boot-freemarker/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies {
1818
optional("org.springframework:spring-webflux")
1919
optional("jakarta.servlet:jakarta.servlet-api")
2020

21+
testImplementation(project(":spring-boot-project:spring-boot-servlet"))
2122
testImplementation(project(":spring-boot-project:spring-boot-test"))
2223
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
2324

spring-boot-project/spring-boot-freemarker/src/test/java/org/springframework/boot/freemarker/autoconfigure/FreeMarkerAutoConfigurationServletIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
3030
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
31+
import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter;
3132
import org.springframework.boot.test.util.TestPropertyValues;
3233
import org.springframework.boot.testsupport.classpath.resources.WithResource;
3334
import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext;
3435
import org.springframework.boot.web.servlet.FilterRegistrationBean;
35-
import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter;
3636
import org.springframework.context.annotation.Bean;
3737
import org.springframework.context.annotation.Configuration;
3838
import org.springframework.context.annotation.Import;

spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import java.util.UUID;
2424

2525
import org.springframework.boot.context.properties.ConfigurationProperties;
26+
import org.springframework.boot.servlet.filter.OrderedFilter;
2627
import org.springframework.boot.web.servlet.DispatcherType;
27-
import org.springframework.boot.web.servlet.filter.OrderedFilter;
2828
import org.springframework.core.Ordered;
2929
import org.springframework.util.StringUtils;
3030

spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
3838
import org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration;
3939
import org.springframework.boot.security.autoconfigure.jpa.City;
40+
import org.springframework.boot.servlet.filter.OrderedFilter;
4041
import org.springframework.boot.test.context.FilteredClassLoader;
4142
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
4243
import org.springframework.boot.testsupport.classpath.resources.WithResource;
4344
import org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean;
44-
import org.springframework.boot.web.servlet.filter.OrderedFilter;
4545
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
4646
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
4747
import org.springframework.context.annotation.Bean;

spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/actuate/autoconfigure/ServletManagementContextAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
2828
import org.springframework.boot.context.properties.EnableConfigurationProperties;
29-
import org.springframework.boot.web.servlet.filter.ApplicationContextHeaderFilter;
29+
import org.springframework.boot.servlet.filter.ApplicationContextHeaderFilter;
3030
import org.springframework.context.ApplicationContext;
3131
import org.springframework.context.annotation.Bean;
3232
import org.springframework.context.annotation.Configuration;

spring-boot-project/spring-boot-servlet/src/main/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2525
import org.springframework.boot.context.properties.EnableConfigurationProperties;
26-
import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter;
26+
import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter;
2727
import org.springframework.context.annotation.Bean;
2828
import org.springframework.web.filter.CharacterEncodingFilter;
2929

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.web.servlet.filter;
17+
package org.springframework.boot.servlet.filter;
1818

1919
import java.io.IOException;
2020

@@ -32,7 +32,7 @@
3232
*
3333
* @author Phillip Webb
3434
* @author Venil Noronha
35-
* @since 2.0.0
35+
* @since 4.0.0
3636
*/
3737
public class ApplicationContextHeaderFilter extends OncePerRequestFilter {
3838

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.web.servlet.filter;
17+
package org.springframework.boot.servlet.filter;
1818

1919
import org.springframework.core.Ordered;
2020
import org.springframework.web.filter.CharacterEncodingFilter;
@@ -23,7 +23,7 @@
2323
* {@link CharacterEncodingFilter} that also implements {@link Ordered}.
2424
*
2525
* @author Phillip Webb
26-
* @since 2.0.0
26+
* @since 4.0.0
2727
*/
2828
public class OrderedCharacterEncodingFilter extends CharacterEncodingFilter implements OrderedFilter {
2929

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.web.servlet.filter;
17+
package org.springframework.boot.servlet.filter;
1818

1919
import jakarta.servlet.Filter;
2020

@@ -24,7 +24,7 @@
2424
* An {@link Ordered} {@link jakarta.servlet.Filter}.
2525
*
2626
* @author Phillip Webb
27-
* @since 2.1.0
27+
* @since 4.0.0
2828
*/
2929
public interface OrderedFilter extends Filter, Ordered {
3030

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.web.servlet.filter;
17+
package org.springframework.boot.servlet.filter;
1818

1919
import org.springframework.core.Ordered;
2020
import org.springframework.web.filter.FormContentFilter;
@@ -24,7 +24,7 @@
2424
*
2525
* @author Joao Pedro Evangelista
2626
* @author Brian Clozel
27-
* @since 2.1.0
27+
* @since 4.0.0
2828
*/
2929
public class OrderedFormContentFilter extends FormContentFilter implements OrderedFilter {
3030

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.web.servlet.filter;
17+
package org.springframework.boot.servlet.filter;
1818

1919
import org.springframework.core.Ordered;
2020
import org.springframework.web.filter.HiddenHttpMethodFilter;
@@ -23,7 +23,7 @@
2323
* {@link HiddenHttpMethodFilter} that also implements {@link Ordered}.
2424
*
2525
* @author Phillip Webb
26-
* @since 2.0.0
26+
* @since 4.0.0
2727
*/
2828
public class OrderedHiddenHttpMethodFilter extends HiddenHttpMethodFilter implements OrderedFilter {
2929

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.web.servlet.filter;
17+
package org.springframework.boot.servlet.filter;
1818

1919
import org.springframework.core.Ordered;
2020
import org.springframework.web.filter.RequestContextFilter;
@@ -23,7 +23,7 @@
2323
* {@link RequestContextFilter} that also implements {@link Ordered}.
2424
*
2525
* @author Phillip Webb
26-
* @since 2.0.0
26+
* @since 4.0.0
2727
*/
2828
public class OrderedRequestContextFilter extends RequestContextFilter implements OrderedFilter {
2929

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,4 +17,4 @@
1717
/**
1818
* Spring Boot specific {@link jakarta.servlet.Filter} implementations.
1919
*/
20-
package org.springframework.boot.web.servlet.filter;
20+
package org.springframework.boot.servlet.filter;

spring-boot-project/spring-boot-servlet/src/test/java/org/springframework/boot/servlet/autoconfigure/HttpEncodingAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
import org.junit.jupiter.api.Test;
2525

2626
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
27+
import org.springframework.boot.servlet.filter.OrderedFormContentFilter;
28+
import org.springframework.boot.servlet.filter.OrderedHiddenHttpMethodFilter;
2729
import org.springframework.boot.test.util.TestPropertyValues;
2830
import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext;
29-
import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter;
30-
import org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter;
3131
import org.springframework.context.annotation.Bean;
3232
import org.springframework.context.annotation.Configuration;
3333
import org.springframework.core.annotation.AnnotationAwareOrderComparator;

spring-boot-project/spring-boot-thymeleaf/src/test/java/org/springframework/boot/thymeleaf/autoconfigure/ThymeleafServletAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
import org.thymeleaf.web.servlet.JakartaServletWebApplication;
4545

4646
import org.springframework.boot.autoconfigure.AutoConfigurations;
47+
import org.springframework.boot.servlet.filter.OrderedCharacterEncodingFilter;
4748
import org.springframework.boot.test.context.FilteredClassLoader;
4849
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
4950
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
5051
import org.springframework.boot.test.system.CapturedOutput;
5152
import org.springframework.boot.test.system.OutputCaptureExtension;
5253
import org.springframework.boot.testsupport.classpath.resources.WithResource;
5354
import org.springframework.boot.web.servlet.FilterRegistrationBean;
54-
import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter;
5555
import org.springframework.context.annotation.Bean;
5656
import org.springframework.context.annotation.Configuration;
5757
import org.springframework.mock.web.MockHttpServletRequest;

spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
27+
import org.springframework.boot.servlet.filter.OrderedRequestContextFilter;
2728
import org.springframework.boot.web.error.ErrorPage;
2829
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
2930
import org.springframework.boot.web.server.autoconfigure.ServerProperties;
3031
import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory;
31-
import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
3232
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
3333
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletRegistrationBean;
3434
import org.springframework.boot.webmvc.error.ErrorAttributes;

spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
import org.springframework.boot.context.properties.EnableConfigurationProperties;
5353
import org.springframework.boot.convert.ApplicationConversionService;
5454
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConverters;
55+
import org.springframework.boot.servlet.filter.OrderedFormContentFilter;
56+
import org.springframework.boot.servlet.filter.OrderedHiddenHttpMethodFilter;
57+
import org.springframework.boot.servlet.filter.OrderedRequestContextFilter;
5558
import org.springframework.boot.validation.autoconfigure.ValidatorAdapter;
5659
import org.springframework.boot.web.servlet.ServletRegistrationBean;
57-
import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter;
58-
import org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter;
59-
import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
6060
import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties.Format;
6161
import org.springframework.context.ApplicationContext;
6262
import org.springframework.context.ResourceLoaderAware;

spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/actuate/autoconfigure/web/WebMvcEndpointChildContextConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
import org.junit.jupiter.api.Test;
2020

21+
import org.springframework.boot.servlet.filter.OrderedRequestContextFilter;
2122
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
22-
import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
2323
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath;
2424
import org.springframework.context.annotation.Bean;
2525
import org.springframework.context.annotation.Configuration;

spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WebMvcAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
4949
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConverters;
5050
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
51+
import org.springframework.boot.servlet.filter.OrderedFormContentFilter;
5152
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
5253
import org.springframework.boot.test.context.runner.ContextConsumer;
5354
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
@@ -61,7 +62,6 @@
6162
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
6263
import org.springframework.boot.web.servlet.FilterRegistrationBean;
6364
import org.springframework.boot.web.servlet.ServletRegistrationBean;
64-
import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter;
6565
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter;
6666
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice;
6767
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.LowestOrderedControllerAdvice;

0 commit comments

Comments
 (0)