From 0cf76bf43ba73d5e0631774da06abe902444d126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Wed, 28 May 2025 15:32:12 +0200 Subject: [PATCH] Move web server specific classes into .*.server.* packages --- .../security/reactive/EndpointRequest.java | 2 +- .../security/servlet/EndpointRequest.java | 2 +- .../ChildManagementContextInitializer.java | 4 +- .../web/server/OnManagementPortCondition.java | 4 +- ...bMvcEndpointChildContextConfiguration.java | 2 +- ...oundryWebFluxEndpointIntegrationTests.java | 2 +- ...FoundryMvcWebEndpointIntegrationTests.java | 2 +- .../JerseyWebEndpointIntegrationTests.java | 2 +- ...rollerEndpointWebFluxIntegrationTests.java | 2 +- ...trollerEndpointWebMvcIntegrationTests.java | 2 +- .../JerseyEndpointAccessIntegrationTests.java | 4 +- .../JerseyEndpointIntegrationTests.java | 2 +- ...ndpointAdditionalPathIntegrationTests.java | 4 +- ...WebFluxEndpointAccessIntegrationTests.java | 4 +- .../WebFluxEndpointCorsIntegrationTests.java | 2 +- ...ndpointAdditionalPathIntegrationTests.java | 6 +- .../WebMvcEndpointAccessIntegrationTests.java | 4 +- ...ebMvcEndpointExposureIntegrationTests.java | 4 +- .../WebMvcEndpointIntegrationTests.java | 2 +- ...ndpointAdditionalPathIntegrationTests.java | 4 +- ...eyServerMetricsAutoConfigurationTests.java | 2 +- .../JettyMetricsAutoConfigurationTests.java | 4 +- .../TomcatMetricsAutoConfigurationTests.java | 4 +- .../EndpointRequestIntegrationTests.java | 2 +- .../reactive/EndpointRequestTests.java | 2 +- ...stractEndpointRequestIntegrationTests.java | 2 +- .../servlet/EndpointRequestTests.java | 2 +- ...JerseyEndpointRequestIntegrationTests.java | 2 +- ...mentWebSecurityAutoConfigurationTests.java | 4 +- .../MvcEndpointRequestIntegrationTests.java | 2 +- ...dContextConfigurationIntegrationTests.java | 6 +- ...dManagementContextInitializerAotTests.java | 4 +- ...nagementContextAutoConfigurationTests.java | 2 +- ...dContextConfigurationIntegrationTests.java | 4 +- .../web/ServletEndpointRegistrar.java | 2 +- ...AbstractWebFluxEndpointHandlerMapping.java | 2 +- .../AbstractWebMvcEndpointHandlerMapping.java | 2 +- .../web/jetty/AbstractJettyMetricsBinder.java | 2 +- .../web/tomcat/TomcatMetricsBinder.java | 2 +- .../DispatcherServletHandlerMappings.java | 2 +- .../JerseyWebEndpointIntegrationTests.java | 2 +- ...ndpointHandlerMappingIntegrationTests.java | 2 +- .../WebFluxEndpointIntegrationTests.java | 4 +- ...ndpointHandlerMappingIntegrationTests.java | 2 +- .../MvcWebEndpointIntegrationTests.java | 2 +- ...EndpointTestInvocationContextProvider.java | 6 +- .../web/mappings/MappingsEndpointTests.java | 2 +- .../ServletWebServerMvcIntegrationTests.java | 2 + .../ErrorPageFilterIntegrationTests.java | 2 +- .../servlet/MultipartAutoConfiguration.java | 2 +- ...icationAdminJmxAutoConfigurationTests.java | 2 +- .../FilterOrderingIntegrationTests.java | 2 +- .../HttpEncodingAutoConfigurationTests.java | 2 +- .../MultipartAutoConfigurationTests.java | 2 +- .../condition/OnWebApplicationCondition.java | 6 +- .../ServletWebServerConfiguration.java | 4 +- .../ServletWebServerFactoryCustomizer.java | 2 +- .../ConditionalOnNotWarDeploymentTests.java | 4 +- .../ConditionalOnWarDeploymentTests.java | 4 +- .../ConditionalOnWebApplicationTests.java | 4 +- ...nEvaluationReportLoggingListenerTests.java | 2 +- ...activeWebServerAutoConfigurationTests.java | 2 +- ...ervletWebServerAutoConfigurationTests.java | 6 +- ...positoryRestMvcAutoConfigurationTests.java | 2 +- .../com/example/DevToolsTestApplication.java | 4 +- .../LocalDevToolsAutoConfigurationTests.java | 2 +- .../RemoteDevToolsAutoConfigurationTests.java | 2 +- .../RemoteClientConfigurationTests.java | 2 +- .../MyCloudFoundryConfiguration.java | 2 +- .../MyErrorPagesConfiguration.java | 8 +- .../MyCloudFoundryConfiguration.kt | 2 +- .../MyErrorPagesConfiguration.kt | 6 +- ...oConfigurationServletIntegrationTests.java | 2 +- .../GraphQlRSocketAutoConfigurationTests.java | 4 +- .../GroovyTemplateAutoConfigurationTests.java | 2 +- .../H2ConsoleAutoConfigurationTests.java | 2 +- ...aAutoConfigurationWithoutJacksonTests.java | 2 +- .../servlet/JettyServletWebServerFactory.java | 4 +- ...ervletContextInitializerConfiguration.java | 2 +- ...activeWebServerAutoConfigurationTests.java | 2 +- ...ervletWebServerAutoConfigurationTests.java | 2 +- ...oConfigurationServletIntegrationTests.java | 2 +- .../servlet/view/MustacheViewTests.java | 2 +- ...ocketWebSocketNettyRouteProviderTests.java | 4 +- .../autoconfigure/servlet/PathRequest.java | 2 +- .../servlet/StaticResourceRequest.java | 2 +- ...ConfigurationEarlyInitializationTests.java | 2 +- .../SecurityFilterAutoConfigurationTests.java | 2 +- .../servlet/TestWebApplicationContext.java | 2 +- ...onEarlyInitializationIntegrationTests.java | 2 +- ...ReactiveSessionAutoConfigurationTests.java | 2 +- ...ringBootMockMvcBuilderCustomizerTests.java | 4 +- ...stEmbeddedReactiveWebEnvironmentTests.java | 2 +- .../test/context/SpringBootContextLoader.java | 2 +- .../boot/test/context/SpringBootTest.java | 6 +- ...sertableReactiveWebApplicationContext.java | 6 +- .../ReactiveWebApplicationContextRunner.java | 6 +- .../runner/WebApplicationContextRunner.java | 4 +- .../HttpGraphQlTesterContextCustomizer.java | 2 +- .../WebTestClientContextCustomizer.java | 2 +- .../context/SpringBootContextLoaderTests.java | 2 +- ...bleReactiveWebApplicationContextTests.java | 4 +- ...ctiveWebApplicationContextRunnerTests.java | 6 +- .../WebApplicationContextRunnerTests.java | 4 +- .../boot/tomcat/TomcatStarter.java | 2 +- .../TomcatServletWebServerFactory.java | 4 +- ...activeWebServerAutoConfigurationTests.java | 2 +- .../UndertowServletWebServerFactory.java | 4 +- .../UndertowServletWebServerFactoryTests.java | 2 +- .../WebFluxAutoConfigurationTests.java | 2 +- .../DefaultErrorWebExceptionHandlerTests.java | 2 +- .../error/ErrorMvcAutoConfiguration.java | 6 +- .../WebMvcAutoConfigurationTests.java | 2 +- .../WelcomePageIntegrationTests.java | 4 +- .../RemappedErrorViewIntegrationTests.java | 6 +- ...SocketMessagingAutoConfigurationTests.java | 2 +- .../boot/SpringApplication.java | 11 +-- ...SpringApplicationAdminMXBeanRegistrar.java | 19 +--- ...onConfigReactiveWebApplicationContext.java | 4 +- ...igurableReactiveWebApplicationContext.java | 4 +- .../ConfigurableReactiveWebEnvironment.java | 4 +- .../FilteredReactiveWebContextResource.java | 4 +- ...iveWebContextResourceFilePathResolver.java | 2 +- .../GenericReactiveWebApplicationContext.java | 4 +- .../ReactiveWebApplicationContext.java | 4 +- .../StandardReactiveWebEnvironment.java | 4 +- .../reactive}/package-info.java | 4 +- ...ionConfigServletWebApplicationContext.java | 4 +- .../ApplicationServletEnvironment.java | 7 +- ...ervletContextResourceFilePathResolver.java | 2 +- .../WebApplicationContextInitializer.java | 94 +++++++++++++++++++ .../servlet}/package-info.java | 4 +- .../boot/web/{server => error}/ErrorPage.java | 6 +- .../{server => error}/ErrorPageRegistrar.java | 6 +- .../ErrorPageRegistrarBeanPostProcessor.java | 4 +- .../{server => error}/ErrorPageRegistry.java | 6 +- .../AbstractConfigurableWebServerFactory.java | 1 + .../server/ConfigurableWebServerFactory.java | 4 +- ...nfigurableWebServerApplicationContext.java | 4 +- .../MissingWebServerFactoryBeanException.java | 4 +- ...ngWebServerFactoryBeanFailureAnalyzer.java | 4 +- ...PortInfoApplicationContextInitializer.java | 4 +- .../context/WebServerApplicationContext.java | 2 +- .../WebServerGracefulShutdownLifecycle.java | 2 +- .../context/WebServerInitializedEvent.java | 4 +- .../context/WebServerPortFileWriter.java | 2 +- .../{ => server}/context/package-info.java | 4 +- ...igReactiveWebServerApplicationContext.java | 2 +- .../ApplicationReactiveWebEnvironment.java | 5 +- .../ReactiveWebServerApplicationContext.java | 9 +- ...iveWebServerApplicationContextFactory.java | 4 +- .../ReactiveWebServerInitializedEvent.java | 6 +- .../reactive/context/WebServerManager.java | 2 +- .../context/WebServerStartStopLifecycle.java | 4 +- .../server/reactive/context/package-info.java | 21 +++++ .../ConfigurableServletWebServerFactory.java | 1 + .../servlet/ServletContextInitializers.java | 1 + .../servlet/ServletWebServerFactory.java | 1 + .../servlet/ServletWebServerSettings.java | 1 + .../servlet/WebListenerRegistrar.java | 4 +- ...figServletWebServerApplicationContext.java | 3 +- .../context}/ServletComponentHandler.java | 2 +- ...vletComponentRegisteringPostProcessor.java | 4 +- .../context}/ServletComponentScan.java | 4 +- .../ServletComponentScanRegistrar.java | 4 +- .../ServletWebServerApplicationContext.java | 84 ++--------------- ...letWebServerApplicationContextFactory.java | 5 +- .../ServletWebServerInitializedEvent.java | 6 +- ...onContextServletContextAwareProcessor.java | 2 +- .../servlet/context}/WebFilterHandler.java | 5 +- .../servlet/context}/WebListenerHandler.java | 3 +- .../context/WebServerStartStopLifecycle.java | 4 +- .../servlet/context}/WebServletHandler.java | 5 +- ...XmlServletWebServerApplicationContext.java | 4 +- .../server/servlet/context/package-info.java | 21 +++++ .../AbstractFilterRegistrationBean.java | 1 - ...DelegatingFilterProxyRegistrationBean.java | 1 - .../web/servlet/FilterRegistrationBean.java | 1 - .../boot/web/servlet/RegistrationBean.java | 1 - .../servlet/ServletContextInitializer.java | 2 +- .../ServletContextInitializerBeans.java | 1 - .../ServletListenerRegistrationBean.java | 1 - .../web/servlet/ServletRegistrationBean.java | 1 - .../web/servlet/support/ErrorPageFilter.java | 6 +- .../support/SpringBootServletInitializer.java | 45 ++++++++- .../main/resources/META-INF/spring.factories | 13 +-- .../boot/SpringApplicationTests.java | 8 +- ...ourceFilePathResolverIntegrationTests.java | 4 +- ...ricReactiveWebApplicationContextTests.java | 4 +- ...ourceFilePathResolverIntegrationTests.java | 2 +- ...ServerFactoryBeanFailureAnalyzerTests.java | 6 +- .../WebServerApplicationContextTests.java | 4 +- .../context/WebServerPortFileWriterTests.java | 4 +- ...ctiveWebServerApplicationContextTests.java | 6 +- ...pplicationReactiveWebEnvironmentTests.java | 4 +- ...ctiveWebServerApplicationContextTests.java | 4 +- ...tiveWebServerApplicationConfiguration.java | 2 +- ...rvletWebServerApplicationContextTests.java | 4 +- .../ApplicationServletEnvironmentTests.java | 5 +- ...tServletComponentScanIntegrationTests.java | 17 ++-- .../ServletComponentScanIntegrationTests.java | 15 +-- .../ServletComponentScanRegistrarTests.java | 22 ++--- ...rvletWebServerApplicationContextTests.java | 6 +- .../context}/WebFilterHandlerTests.java | 2 +- .../context}/WebListenerHandlerTests.java | 4 +- .../context}/WebServletHandlerTests.java | 2 +- ...rvletWebServerApplicationContextTests.java | 2 +- ...vletWebServerApplicationConfiguration.java | 2 +- .../testcomponents/filter/TestFilter.java | 4 +- .../testcomponents/listener/TestListener.java | 4 +- .../servlet/TestMultipartServlet.java | 4 +- .../testcomponents/servlet/TestServlet.java | 4 +- .../FilterRegistrationIntegrationTests.java | 2 +- .../ServletContextInitializerBeansTests.java | 1 - .../servlet/support/ErrorPageFilterTests.java | 4 +- ...pleEmbeddedWebApplicationConfiguration.xml | 0 .../AbstractServletWebServerFactoryTests.java | 3 +- ...tWebServerServletContextListenerTests.java | 2 +- .../servlet/MockServletWebServerFactory.java | 1 + .../example/ResourceHandlingApplication.java | 2 +- ...leTomcatTwoConnectorsApplicationTests.java | 2 +- .../tomcat/SampleTomcatApplicationTests.java | 2 +- .../SampleTomcat11ApplicationTests.java | 2 +- ...pleWebApplicationTypeApplicationTests.java | 4 +- ...tNoneOverridesWebApplicationTypeTests.java | 4 +- src/checkstyle/import-control.xml | 68 ++++---------- 226 files changed, 592 insertions(+), 516 deletions(-) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/AnnotationConfigReactiveWebApplicationContext.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/ConfigurableReactiveWebApplicationContext.java (89%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/ConfigurableReactiveWebEnvironment.java (89%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/FilteredReactiveWebContextResource.java (94%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/FilteredReactiveWebContextResourceFilePathResolver.java (95%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/GenericReactiveWebApplicationContext.java (94%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/ReactiveWebApplicationContext.java (88%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/StandardReactiveWebEnvironment.java (92%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{reactive/context => context/reactive}/package-info.java (86%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet/context => context/servlet}/AnnotationConfigServletWebApplicationContext.java (98%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet/context => context/servlet}/ApplicationServletEnvironment.java (87%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet/context => context/servlet}/ServletContextResourceFilePathResolver.java (96%) create mode 100644 spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/WebApplicationContextInitializer.java rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet/context => context/servlet}/package-info.java (86%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{server => error}/ErrorPage.java (96%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{server => error}/ErrorPageRegistrar.java (88%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{server => error}/ErrorPageRegistrarBeanPostProcessor.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{server => error}/ErrorPageRegistry.java (88%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/ConfigurableWebServerApplicationContext.java (92%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/MissingWebServerFactoryBeanException.java (95%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/MissingWebServerFactoryBeanFailureAnalyzer.java (93%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/ServerPortInfoApplicationContextInitializer.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/WebServerApplicationContext.java (98%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/WebServerGracefulShutdownLifecycle.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/WebServerInitializedEvent.java (94%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/WebServerPortFileWriter.java (98%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/context/package-info.java (86%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java (99%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/ApplicationReactiveWebEnvironment.java (87%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/ReactiveWebServerApplicationContext.java (93%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/ReactiveWebServerApplicationContextFactory.java (94%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/ReactiveWebServerInitializedEvent.java (86%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/WebServerManager.java (98%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/reactive/context/WebServerStartStopLifecycle.java (91%) create mode 100644 spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/WebListenerRegistrar.java (89%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/AnnotationConfigServletWebServerApplicationContext.java (98%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/ServletComponentHandler.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/ServletComponentRegisteringPostProcessor.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/ServletComponentScan.java (95%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/ServletComponentScanRegistrar.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/ServletWebServerApplicationContext.java (75%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/ServletWebServerApplicationContextFactory.java (91%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/ServletWebServerInitializedEvent.java (89%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/WebApplicationContextServletContextAwareProcessor.java (97%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/WebFilterHandler.java (93%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/WebListenerHandler.java (93%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/WebServerStartStopLifecycle.java (92%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{servlet => server/servlet/context}/WebServletHandler.java (94%) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{ => server}/servlet/context/XmlServletWebServerApplicationContext.java (97%) create mode 100644 spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/{server => }/servlet/ServletContextInitializer.java (97%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{reactive/context => context/reactive}/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java (94%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{reactive/context => context/reactive}/GenericReactiveWebApplicationContextTests.java (91%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet/context => context/servlet}/ServletContextResourceFilePathResolverIntegrationTests.java (97%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java (92%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/context/WebServerApplicationContextTests.java (94%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/context/WebServerPortFileWriterTests.java (98%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java (94%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/reactive/context/ApplicationReactiveWebEnvironmentTests.java (89%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/reactive/context/ReactiveWebServerApplicationContextTests.java (98%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java (95%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java (97%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/servlet/context/ApplicationServletEnvironmentTests.java (83%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/MockWebEnvironmentServletComponentScanIntegrationTests.java (86%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/ServletComponentScanIntegrationTests.java (89%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/ServletComponentScanRegistrarTests.java (92%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/servlet/context/ServletWebServerApplicationContextTests.java (99%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/WebFilterHandlerTests.java (99%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/WebListenerHandlerTests.java (95%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/WebServletHandlerTests.java (99%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/servlet/context/XmlServletWebServerApplicationContextTests.java (97%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{ => server}/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java (95%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/testcomponents/filter/TestFilter.java (90%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/testcomponents/listener/TestListener.java (92%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/testcomponents/servlet/TestMultipartServlet.java (86%) rename spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/{servlet => server/servlet/context}/testcomponents/servlet/TestServlet.java (90%) rename spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/{ => server}/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml (100%) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java index 638c4fa324..68c5da2a8d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java @@ -37,7 +37,7 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; import org.springframework.boot.security.reactive.ApplicationContextServerWebExchangeMatcher; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.core.annotation.MergedAnnotation; import org.springframework.core.annotation.MergedAnnotations; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java index ce7a1341b7..86c87880dd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java @@ -37,7 +37,7 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.core.annotation.MergedAnnotation; import org.springframework.core.annotation.MergedAnnotations; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java index 0bf5ce431c..0c1aded3e6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java @@ -32,8 +32,8 @@ import org.springframework.boot.LazyInitializationBeanFactoryPostProcessor; import org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.context.event.ApplicationFailedEvent; -import org.springframework.boot.web.context.ConfigurableWebServerApplicationContext; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.ConfigurableWebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ApplicationEvent; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/OnManagementPortCondition.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/OnManagementPortCondition.java index 4cdee48ddc..b5be1f5890 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/OnManagementPortCondition.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/OnManagementPortCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -21,7 +21,7 @@ import java.util.Map; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebApplicationContext; import org.springframework.context.annotation.ConditionContext; import org.springframework.core.io.ResourceLoader; import org.springframework.core.type.AnnotatedTypeMetadata; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java index 8c36fdbb7b..2ce58628f0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java @@ -25,7 +25,7 @@ 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.autoconfigure.web.ServerProperties; -import org.springframework.boot.web.server.ErrorPage; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java index bf6dba9f3d..88249222ed 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java @@ -48,7 +48,7 @@ import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServ import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java index eddc0f1c3e..699bf4f862 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java @@ -45,7 +45,7 @@ import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint; import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; 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-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java index 6a7485a62c..5039c2b1e0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java @@ -30,7 +30,7 @@ import org.springframework.boot.jersey.autoconfigure.JerseyAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.DispatcherServlet; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java index f7de1aac64..51873a75c4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java @@ -31,7 +31,7 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.AnnotationConfigReactiveWebApplicationContext; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.security.authentication.TestingAuthenticationToken; import org.springframework.security.test.context.TestSecurityContextHolder; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java index f8210cab91..c363a2c712 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java @@ -31,7 +31,7 @@ import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConf import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointAccessIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointAccessIntegrationTests.java index 16545a7f92..47c4b78f2e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointAccessIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointAccessIntegrationTests.java @@ -37,8 +37,8 @@ import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.test.web.reactive.server.EntityExchangeResult; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointIntegrationTests.java index a4a1b5899d..27840a48af 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfi import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.web.reactive.server.WebTestClient; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyHealthEndpointAdditionalPathIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyHealthEndpointAdditionalPathIntegrationTests.java index 56163694f4..48aa270111 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyHealthEndpointAdditionalPathIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyHealthEndpointAdditionalPathIntegrationTests.java @@ -30,8 +30,8 @@ import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.web.context.ConfigurableWebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java index 6ffe211b55..c881798ae1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java @@ -29,8 +29,8 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.http.HttpMethod; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java index 6a466b5215..792f6ab072 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java @@ -30,7 +30,7 @@ import org.springframework.boot.http.codec.autoconfigure.CodecsAutoConfiguration import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.http.HttpHeaders; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java index 1f681eedd8..de351b3f7e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java @@ -29,9 +29,9 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointAccessIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointAccessIntegrationTests.java index e71beb7c5d..e9b6707709 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointAccessIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointAccessIntegrationTests.java @@ -37,8 +37,8 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.http.HttpMethod; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java index 4fef7104f8..6129515bc3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java @@ -40,8 +40,8 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java index 53326a632c..c8d4bb3476 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConf import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcHealthEndpointAdditionalPathIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcHealthEndpointAdditionalPathIntegrationTests.java index 3969d235c5..bafd3aad53 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcHealthEndpointAdditionalPathIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcHealthEndpointAdditionalPathIntegrationTests.java @@ -29,8 +29,8 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.web.context.ConfigurableWebApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfigurationTests.java index 6e2e20fc98..ea725d3713 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfigurationTests.java @@ -39,7 +39,7 @@ import org.springframework.boot.test.context.assertj.AssertableWebApplicationCon import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/jetty/JettyMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/jetty/JettyMetricsAutoConfigurationTests.java index 1449843fa0..4105463531 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/jetty/JettyMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/jetty/JettyMetricsAutoConfigurationTests.java @@ -34,8 +34,8 @@ import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java index 572c5a9562..4519dacd0b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java @@ -36,8 +36,8 @@ import org.springframework.boot.tomcat.autoconfigure.reactive.TomcatReactiveWebS import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java index 592bed0eff..f4bc85236a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.security.autoconfigure.reactive.ReactiveUserDeta import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java index 18ac34841d..add6e3ffd4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java @@ -32,8 +32,8 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.support.StaticApplicationContext; import org.springframework.http.HttpMethod; import org.springframework.http.server.reactive.ServerHttpRequest; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java index 3435b41b85..3b60b584dc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java @@ -38,7 +38,7 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java index 1f1cea6886..c030d85fc2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java @@ -34,8 +34,8 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.http.HttpMethod; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockServletContext; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java index 812908b72a..eaad35d054 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/JerseyEndpointRequestIntegrationTests.java @@ -26,7 +26,7 @@ import org.springframework.boot.jersey.autoconfigure.JerseyAutoConfiguration; import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java index 12e799b447..82aee17d2b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java @@ -37,9 +37,9 @@ import org.springframework.boot.test.context.FilteredClassLoader; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; 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-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java index 2b795faa09..b7a04fe266 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/MvcEndpointRequestIntegrationTests.java @@ -24,7 +24,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java index f2522418eb..011f3cc56e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationIntegrationTests.java @@ -43,10 +43,10 @@ import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.autoconfigure.reactive.TomcatReactiveWebServerAutoConfiguration; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; -import org.springframework.boot.web.context.WebServerInitializedEvent; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; +import org.springframework.boot.web.server.context.WebServerInitializedEvent; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializerAotTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializerAotTests.java index e7be69b4fb..9bb2c44e79 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializerAotTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializerAotTests.java @@ -34,8 +34,8 @@ import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.aot.ApplicationContextAotGenerator; import org.springframework.context.support.GenericApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfigurationTests.java index c543f7a972..d375cd7905 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfigurationTests.java @@ -30,7 +30,7 @@ import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java index 168775ff7e..32a7798a9d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java @@ -42,8 +42,8 @@ import org.springframework.boot.test.context.assertj.AssertableWebApplicationCon import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.error.ErrorMvcAutoConfiguration; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java index 5adb2b6360..3c82519d1c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java @@ -37,7 +37,7 @@ import org.apache.commons.logging.LogFactory; import org.springframework.boot.actuate.endpoint.Access; import org.springframework.boot.actuate.endpoint.EndpointAccessResolver; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java index be10ecdad3..62bddd46c8 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java @@ -50,7 +50,7 @@ import org.springframework.boot.actuate.endpoint.web.WebOperation; import org.springframework.boot.actuate.endpoint.web.WebOperationRequestPredicate; import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; import org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.AbstractWebFluxEndpointHandlerMappingRuntimeHints; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.annotation.ImportRuntimeHints; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index 5a4cd188ee..0fabf0b167 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -51,7 +51,7 @@ import org.springframework.boot.actuate.endpoint.web.WebOperation; import org.springframework.boot.actuate.endpoint.web.WebOperationRequestPredicate; import org.springframework.boot.actuate.endpoint.web.WebServerNamespace; import org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.AbstractWebMvcEndpointHandlerMappingRuntimeHints; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.annotation.ImportRuntimeHints; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/jetty/AbstractJettyMetricsBinder.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/jetty/AbstractJettyMetricsBinder.java index 7d1d027461..5cb523b04f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/jetty/AbstractJettyMetricsBinder.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/jetty/AbstractJettyMetricsBinder.java @@ -20,8 +20,8 @@ import org.eclipse.jetty.server.Server; import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.boot.jetty.JettyWebServer; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java index a09c21ff4e..b30117814c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/tomcat/TomcatMetricsBinder.java @@ -28,8 +28,8 @@ import org.apache.catalina.Manager; import org.springframework.beans.factory.DisposableBean; import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.boot.tomcat.TomcatWebServer; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java index d0289719f9..e2d2c2d467 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletHandlerMappings.java @@ -29,7 +29,7 @@ import org.apache.catalina.core.StandardWrapper; import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.undertow.servlet.UndertowServletWebServer; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.util.ClassUtils; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java index 23e6b807b9..c14a7d074c 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java @@ -41,8 +41,8 @@ import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes; import org.springframework.boot.actuate.endpoint.web.annotation.AbstractWebEndpointIntegrationTests; import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java index 4fd13e206a..e2d1da5fad 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java index fcefaf8df9..e4c3258988 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java @@ -27,8 +27,8 @@ import org.springframework.boot.actuate.endpoint.web.annotation.AbstractWebEndpo import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.reactive.context.ReactiveWebServerInitializedEvent; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.ReactiveWebServerInitializedEvent; import org.springframework.boot.webflux.autoconfigure.error.ErrorWebFluxAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java index 8d66601f5b..c75bbf5db8 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.test.context.assertj.AssertableWebApplicationCon import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; 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-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java index 60f4b7f361..b217af1b6e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java @@ -36,7 +36,7 @@ import org.springframework.boot.http.autoconfigure.HttpMessageConvertersAutoConf import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.error.ErrorMvcAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java index a6acfc1015..a3fd817e26 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java @@ -54,9 +54,9 @@ import org.springframework.boot.jersey.autoconfigure.JerseyAutoConfiguration; import org.springframework.boot.jersey.autoconfigure.ResourceConfigCustomizer; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.context.WebServerInitializedEvent; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerInitializedEvent; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java index 5516fa69f5..4b0d8be50b 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/mappings/MappingsEndpointTests.java @@ -40,8 +40,8 @@ import org.springframework.boot.actuate.web.mappings.servlet.ServletRegistration import org.springframework.boot.actuate.web.mappings.servlet.ServletsMappingDescriptionProvider; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; 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-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java b/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java index 9e909f5eb2..09d5dfd0cd 100644 --- a/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java +++ b/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java @@ -28,6 +28,8 @@ import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java b/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java index f164435129..81e6603a8f 100644 --- a/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot-all-integration-tests/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.support.ErrorPageFilterIntegrationTests.EmbeddedWebContextLoader; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java index ead7deea6d..0dc4c50f3c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfiguration.java @@ -27,7 +27,7 @@ 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.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.web.multipart.MultipartResolver; import org.springframework.web.multipart.support.StandardServletMultipartResolver; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java index 0069fb312c..52cbdb7c65 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; 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 4381ddf4f5..7d8fd9ae3f 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 @@ -31,7 +31,7 @@ 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.servlet.context.AnnotationConfigServletWebServerApplicationContext; +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; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java index 0f3d758322..a98ad08b39 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfigurationTests.java @@ -25,9 +25,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.test.util.TestPropertyValues; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.servlet.filter.OrderedFormContentFilter; import org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java index 41592fd77d..d364089466 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java @@ -35,7 +35,7 @@ import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java index 9db6d9b1fd..2b146afec9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -20,8 +20,8 @@ import java.util.Map; import org.springframework.boot.autoconfigure.AutoConfigurationMetadata; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebEnvironment; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebEnvironment; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; import org.springframework.core.Ordered; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java index cb9e8766d0..dec2975057 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerConfiguration.java @@ -30,11 +30,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.ssl.SslBundles; -import org.springframework.boot.web.server.ErrorPageRegistrarBeanPostProcessor; +import org.springframework.boot.web.error.ErrorPageRegistrarBeanPostProcessor; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; +import org.springframework.boot.web.server.servlet.WebListenerRegistrar; import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.boot.web.servlet.WebListenerRegistrar; 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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java index 02b3ba5b8a..3981654250 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/server/servlet/ServletWebServerFactoryCustomizer.java @@ -25,7 +25,7 @@ import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; -import org.springframework.boot.web.servlet.WebListenerRegistrar; +import org.springframework.boot.web.server.servlet.WebListenerRegistrar; import org.springframework.core.Ordered; import org.springframework.util.CollectionUtils; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWarDeploymentTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWarDeploymentTests.java index d713aa146b..4d18ad4db3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWarDeploymentTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnNotWarDeploymentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java index c3507f9bcf..ada5022e70 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWarDeploymentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java index 45ef33babd..1435333d6a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnWebApplicationTests.java @@ -21,10 +21,10 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java index 66d8d44a19..ac183c1232 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.event.ApplicationFailedEvent; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java index e676c40a5f..0f12118367 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/reactive/AbstractReactiveWebServerAutoConfigurationTests.java @@ -22,12 +22,12 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.ssl.DefaultSslBundleRegistry; import org.springframework.boot.ssl.NoSuchSslBundleException; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.server.ConfigurableWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.server.reactive.ConfigurableReactiveWebServerFactory; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.context.ApplicationContextException; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java index 00e48085eb..63d8c0440d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/testFixtures/java/org/springframework/boot/autoconfigure/web/server/servlet/AbstractServletWebServerAutoConfigurationTests.java @@ -36,17 +36,17 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; 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.ServletContextInitializer; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; diff --git a/spring-boot-project/spring-boot-data-rest/src/test/java/org/springframework/boot/data/rest/autoconfigure/RepositoryRestMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-data-rest/src/test/java/org/springframework/boot/data/rest/autoconfigure/RepositoryRestMvcAutoConfigurationTests.java index 1dd0c079c6..f2676cf266 100644 --- a/spring-boot-project/spring-boot-data-rest/src/test/java/org/springframework/boot/data/rest/autoconfigure/RepositoryRestMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-data-rest/src/test/java/org/springframework/boot/data/rest/autoconfigure/RepositoryRestMvcAutoConfigurationTests.java @@ -30,7 +30,7 @@ import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration; import org.springframework.boot.jpa.autoconfigure.hibernate.HibernateJpaAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; 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-devtools/src/intTest/java/com/example/DevToolsTestApplication.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/DevToolsTestApplication.java index b5f045d53b..609819cbb9 100644 --- a/spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/DevToolsTestApplication.java +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/DevToolsTestApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,7 @@ package com.example; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.context.WebServerPortFileWriter; +import org.springframework.boot.web.server.context.WebServerPortFileWriter; @SpringBootApplication class DevToolsTestApplication { diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java index dbed3b5338..b62f62dc00 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java @@ -45,7 +45,7 @@ import org.springframework.boot.devtools.restart.Restarter; import org.springframework.boot.freemarker.autoconfigure.FreeMarkerAutoConfiguration; import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java index 622b5b2dc3..860923c723 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java @@ -33,7 +33,7 @@ import org.springframework.boot.devtools.restart.server.HttpRestartServer; import org.springframework.boot.devtools.restart.server.SourceDirectoryUrlFilter; import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java index 2a4f496531..99b5ba94fc 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/RemoteClientConfigurationTests.java @@ -41,7 +41,7 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java index f36cd1f372..6a87f92624 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.java @@ -31,7 +31,7 @@ import org.apache.catalina.core.StandardContext; import org.apache.catalina.startup.Tomcat; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java index 531b1c2fe2..a72a28f4e1 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -16,9 +16,9 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorpageswithoutspringmvc; -import org.springframework.boot.web.server.ErrorPage; -import org.springframework.boot.web.server.ErrorPageRegistrar; -import org.springframework.boot.web.server.ErrorPageRegistry; +import org.springframework.boot.web.error.ErrorPage; +import org.springframework.boot.web.error.ErrorPageRegistrar; +import org.springframework.boot.web.error.ErrorPageRegistry; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt index 95ed63c2f4..74dde5d6a6 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/actuator/cloudfoundry/customcontextpath/MyCloudFoundryConfiguration.kt @@ -26,8 +26,8 @@ import jakarta.servlet.ServletResponse import org.apache.catalina.Host import org.apache.catalina.core.StandardContext import org.apache.catalina.startup.Tomcat.FixContextListener -import org.springframework.boot.web.server.servlet.ServletContextInitializer import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory +import org.springframework.boot.web.servlet.ServletContextInitializer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import java.io.IOException diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.kt index 3310275269..5f058930ac 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/servlet/springmvc/errorhandling/errorpageswithoutspringmvc/MyErrorPagesConfiguration.kt @@ -16,9 +16,9 @@ package org.springframework.boot.docs.web.servlet.springmvc.errorhandling.errorpageswithoutspringmvc -import org.springframework.boot.web.server.ErrorPage -import org.springframework.boot.web.server.ErrorPageRegistrar -import org.springframework.boot.web.server.ErrorPageRegistry +import org.springframework.boot.web.error.ErrorPage +import org.springframework.boot.web.error.ErrorPageRegistrar +import org.springframework.boot.web.error.ErrorPageRegistry import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.http.HttpStatus 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 5626b62e5a..135e1bd0c9 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 @@ -30,8 +30,8 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; 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.context.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-graphql/src/test/java/org/springframework/boot/graphql/autoconfigure/rsocket/GraphQlRSocketAutoConfigurationTests.java b/spring-boot-project/spring-boot-graphql/src/test/java/org/springframework/boot/graphql/autoconfigure/rsocket/GraphQlRSocketAutoConfigurationTests.java index 66d2fd72b7..3cda2b3808 100644 --- a/spring-boot-project/spring-boot-graphql/src/test/java/org/springframework/boot/graphql/autoconfigure/rsocket/GraphQlRSocketAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-graphql/src/test/java/org/springframework/boot/graphql/autoconfigure/rsocket/GraphQlRSocketAutoConfigurationTests.java @@ -36,8 +36,8 @@ import org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfi import org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.webflux.autoconfigure.HttpHandlerAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration; import org.springframework.boot.webflux.autoconfigure.error.ErrorWebFluxAutoConfiguration; diff --git a/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java b/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java index f82bd81ab7..bdaf19cc9d 100644 --- a/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.testsupport.BuildOutput; import org.springframework.boot.testsupport.classpath.resources.WithResource; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.core.io.ClassPathResource; import org.springframework.mock.web.MockHttpServletRequest; diff --git a/spring-boot-project/spring-boot-h2console/src/test/java/org/springframework/boot/h2console/autoconfigure/H2ConsoleAutoConfigurationTests.java b/spring-boot-project/spring-boot-h2console/src/test/java/org/springframework/boot/h2console/autoconfigure/H2ConsoleAutoConfigurationTests.java index 13843b268a..16597e200e 100644 --- a/spring-boot-project/spring-boot-h2console/src/test/java/org/springframework/boot/h2console/autoconfigure/H2ConsoleAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-h2console/src/test/java/org/springframework/boot/h2console/autoconfigure/H2ConsoleAutoConfigurationTests.java @@ -36,8 +36,8 @@ import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java b/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java index 5ed30d82a4..9a921fb924 100644 --- a/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java +++ b/spring-boot-project/spring-boot-hateoas/src/test/java/org/springframework/boot/hateoas/autoconfigure/HypermediaAutoConfigurationWithoutJacksonTests.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.mock.web.MockServletContext; /** diff --git a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/JettyServletWebServerFactory.java b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/JettyServletWebServerFactory.java index 0421f21e1b..4a83dd534f 100644 --- a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/JettyServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/JettyServletWebServerFactory.java @@ -73,8 +73,8 @@ import org.springframework.boot.jetty.ForwardHeadersCustomizer; import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.JettyWebServer; import org.springframework.boot.jetty.JettyWebServerFactory; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.Cookie.SameSite; -import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.MimeMappings; import org.springframework.boot.web.server.Shutdown; import org.springframework.boot.web.server.Ssl; @@ -83,10 +83,10 @@ import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerF import org.springframework.boot.web.server.servlet.ContextPath; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; import org.springframework.boot.web.server.servlet.DocumentRoot; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.server.servlet.ServletContextInitializers; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerSettings; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/ServletContextInitializerConfiguration.java b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/ServletContextInitializerConfiguration.java index 82c5e50253..8033c3ade9 100644 --- a/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/ServletContextInitializerConfiguration.java +++ b/spring-boot-project/spring-boot-jetty/src/main/java/org/springframework/boot/jetty/servlet/ServletContextInitializerConfiguration.java @@ -21,8 +21,8 @@ import org.eclipse.jetty.ee10.webapp.AbstractConfiguration; import org.eclipse.jetty.ee10.webapp.Configuration; import org.eclipse.jetty.ee10.webapp.WebAppContext; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.server.servlet.ServletContextInitializers; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.util.Assert; /** diff --git a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java index 7aa5cf74ba..c30273afc8 100644 --- a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/reactive/JettyReactiveWebServerAutoConfigurationTests.java @@ -26,9 +26,9 @@ import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReacti import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.JettyWebServer; import org.springframework.boot.jetty.reactive.JettyReactiveWebServerFactory; -import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java index fdc4d58983..83bfd33725 100644 --- a/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-jetty/src/test/java/org/springframework/boot/jetty/autoconfigure/servlet/JettyServletWebServerAutoConfigurationTests.java @@ -28,8 +28,8 @@ import org.springframework.boot.autoconfigure.web.server.servlet.AbstractServlet import org.springframework.boot.jetty.JettyServerCustomizer; import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.AbstractFilterRegistrationBean; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/autoconfigure/MustacheAutoConfigurationServletIntegrationTests.java b/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/autoconfigure/MustacheAutoConfigurationServletIntegrationTests.java index eaf195c7c2..97e858f90c 100644 --- a/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/autoconfigure/MustacheAutoConfigurationServletIntegrationTests.java +++ b/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/autoconfigure/MustacheAutoConfigurationServletIntegrationTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; 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-mustache/src/test/java/org/springframework/boot/mustache/servlet/view/MustacheViewTests.java b/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/servlet/view/MustacheViewTests.java index c57578ce34..3ca65b3957 100644 --- a/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/servlet/view/MustacheViewTests.java +++ b/spring-boot-project/spring-boot-mustache/src/test/java/org/springframework/boot/mustache/servlet/view/MustacheViewTests.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.testsupport.classpath.resources.WithResource; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.mock.web.MockServletContext; diff --git a/spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProviderTests.java b/spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProviderTests.java index c09b7b0840..3b6968bfea 100644 --- a/spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProviderTests.java +++ b/spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProviderTests.java @@ -28,9 +28,9 @@ import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportL import org.springframework.boot.logging.LogLevel; import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; 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-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/PathRequest.java b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/PathRequest.java index 90ea621b6d..dff522155a 100644 --- a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/PathRequest.java +++ b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/PathRequest.java @@ -23,7 +23,7 @@ import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.h2console.autoconfigure.H2ConsoleProperties; import org.springframework.boot.security.autoconfigure.StaticResourceLocation; import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; diff --git a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/StaticResourceRequest.java b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/StaticResourceRequest.java index ab4c2eabcd..0f3b909b55 100644 --- a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/servlet/StaticResourceRequest.java @@ -26,7 +26,7 @@ import jakarta.servlet.http.HttpServletRequest; import org.springframework.boot.security.autoconfigure.StaticResourceLocation; import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher; -import org.springframework.boot.web.context.WebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath; import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher; import org.springframework.security.web.util.matcher.OrRequestMatcher; diff --git a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java index 0a1d8e33b9..e76687a07f 100644 --- a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java +++ b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationEarlyInitializationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationTests.java b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationTests.java index faf6dc874a..9f6675e9da 100644 --- a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationTests.java @@ -26,7 +26,7 @@ import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAut import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.DeserializerBean; import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.ExampleController; import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.JacksonModuleBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/TestWebApplicationContext.java b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/TestWebApplicationContext.java index fd3a12ccc6..bcd02cf61a 100644 --- a/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/TestWebApplicationContext.java +++ b/spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/TestWebApplicationContext.java @@ -16,8 +16,8 @@ package org.springframework.boot.security.autoconfigure.servlet; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.web.context.support.StaticWebApplicationContext; /** diff --git a/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationEarlyInitializationIntegrationTests.java b/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationEarlyInitializationIntegrationTests.java index b70c07d9d8..7179165850 100644 --- a/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationEarlyInitializationIntegrationTests.java +++ b/spring-boot-project/spring-boot-session/src/test/java/org/springframework/boot/session/autoconfigure/SessionAutoConfigurationEarlyInitializationIntegrationTests.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-session/src/testFixtures/java/org/springframework/boot/session/autoconfigure/AbstractReactiveSessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-session/src/testFixtures/java/org/springframework/boot/session/autoconfigure/AbstractReactiveSessionAutoConfigurationTests.java index 3182f956bd..430fadcf9a 100644 --- a/spring-boot-project/spring-boot-session/src/testFixtures/java/org/springframework/boot/session/autoconfigure/AbstractReactiveSessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-session/src/testFixtures/java/org/springframework/boot/session/autoconfigure/AbstractReactiveSessionAutoConfigurationTests.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java index 87c5cee78d..d25307d51a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -38,8 +38,8 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.autoconfigure.web.servlet.SpringBootMockMvcBuilderCustomizer.DeferredLinesWriter; import org.springframework.boot.test.autoconfigure.web.servlet.SpringBootMockMvcBuilderCustomizer.LinesWriter; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.mock.web.MockServletContext; diff --git a/spring-boot-project/spring-boot-test-integration-tests/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot-test-integration-tests/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java index 6d47534530..dfb7ee641d 100644 --- a/spring-boot-project/spring-boot-test-integration-tests/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test-integration-tests/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java @@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java index d5b96e2e5c..55de6ddb15 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java @@ -40,7 +40,7 @@ import org.springframework.boot.test.context.SpringBootTest.UseMainMethod; import org.springframework.boot.test.mock.web.SpringBootMockServletContext; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.test.util.TestPropertyValues.Type; -import org.springframework.boot.web.reactive.context.GenericReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.GenericReactiveWebApplicationContext; import org.springframework.boot.web.servlet.support.ServletContextApplicationContextInitializer; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextInitializer; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java index 41cb55b155..84d9b215b2 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -30,8 +30,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.WebApplicationType; import org.springframework.boot.test.web.server.LocalServerPort; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AliasFor; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContext.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContext.java index c18ec13eb6..3c76ea1df1 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContext.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -18,8 +18,8 @@ package org.springframework.boot.test.context.assertj; import java.util.function.Supplier; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; /** * A {@link ReactiveWebApplicationContext} that additionally supports AssertJ style diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunner.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunner.java index 6274b01bf2..1dd546904f 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunner.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -19,8 +19,8 @@ package org.springframework.boot.test.context.runner; import java.util.function.Supplier; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebApplicationContext; /** * An {@link AbstractApplicationContextRunner ApplicationContext runner} for a diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/WebApplicationContextRunner.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/WebApplicationContextRunner.java index 5528bdbb81..e6ffe3aca3 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/WebApplicationContextRunner.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/WebApplicationContextRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -19,7 +19,7 @@ package org.springframework.boot.test.context.runner; import java.util.function.Supplier; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.mock.web.MockServletContext; import org.springframework.web.context.ConfigurableWebApplicationContext; import org.springframework.web.context.WebApplicationContext; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizer.java index ed90ef739d..e6d58b135d 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/graphql/tester/HttpGraphQlTesterContextCustomizer.java @@ -124,7 +124,7 @@ class HttpGraphQlTesterContextCustomizer implements ContextCustomizer { private static final String SERVLET_APPLICATION_CONTEXT_CLASS = "org.springframework.web.context.WebApplicationContext"; - private static final String REACTIVE_APPLICATION_CONTEXT_CLASS = "org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext"; + private static final String REACTIVE_APPLICATION_CONTEXT_CLASS = "org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext"; private ApplicationContext applicationContext; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java index 2ade67c31c..2749b79b78 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/reactive/server/WebTestClientContextCustomizer.java @@ -141,7 +141,7 @@ class WebTestClientContextCustomizer implements ContextCustomizer { private static final String SERVLET_APPLICATION_CONTEXT_CLASS = "org.springframework.web.context.WebApplicationContext"; - private static final String REACTIVE_APPLICATION_CONTEXT_CLASS = "org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext"; + private static final String REACTIVE_APPLICATION_CONTEXT_CLASS = "org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext"; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java index 67fd2e5172..9f318bad15 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/SpringBootContextLoaderTests.java @@ -33,7 +33,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.test.context.SpringBootTest.UseMainMethod; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.web.reactive.context.GenericReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.GenericReactiveWebApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContextTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContextTests.java index 4aa46f2de3..3d0e4cda7c 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContextTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/AssertableReactiveWebApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -18,7 +18,7 @@ package org.springframework.boot.test.context.assertj; import org.junit.jupiter.api.Test; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebApplicationContext; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunnerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunnerTests.java index cf7a66f901..314602b25f 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunnerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ReactiveWebApplicationContextRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -17,8 +17,8 @@ package org.springframework.boot.test.context.runner; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.ConfigurableReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ConfigurableReactiveWebApplicationContext; /** * Tests for {@link ReactiveWebApplicationContextRunner}. diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/WebApplicationContextRunnerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/WebApplicationContextRunnerTests.java index 8d2ede8f98..b80172bae4 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/WebApplicationContextRunnerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/WebApplicationContextRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -19,7 +19,7 @@ package org.springframework.boot.test.context.runner; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; import org.springframework.mock.web.MockServletContext; import org.springframework.web.context.ConfigurableWebApplicationContext; diff --git a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java index 4740710f7e..35c765fa17 100644 --- a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/TomcatStarter.java @@ -24,7 +24,7 @@ import jakarta.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.ServletContextInitializer; /** * {@link ServletContainerInitializer} used to trigger {@link ServletContextInitializer diff --git a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java index 1c14d40145..5ceec071af 100644 --- a/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/servlet/TomcatServletWebServerFactory.java @@ -72,17 +72,17 @@ import org.springframework.boot.tomcat.TomcatEmbeddedWebappClassLoader; import org.springframework.boot.tomcat.TomcatStarter; import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.TomcatWebServerFactory; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.Cookie.SameSite; -import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.MimeMappings; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.ContextPath; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; import org.springframework.boot.web.server.servlet.DocumentRoot; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.server.servlet.ServletContextInitializers; import org.springframework.boot.web.server.servlet.ServletWebServerSettings; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java index df93e3a058..8f80e528a9 100644 --- a/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/reactive/TomcatReactiveWebServerAutoConfigurationTests.java @@ -30,9 +30,9 @@ import org.springframework.boot.tomcat.TomcatContextCustomizer; import org.springframework.boot.tomcat.TomcatProtocolHandlerCustomizer; import org.springframework.boot.tomcat.TomcatWebServer; import org.springframework.boot.tomcat.reactive.TomcatReactiveWebServerFactory; -import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactory.java b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactory.java index 6b42384030..cb32154190 100644 --- a/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-undertow/src/main/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactory.java @@ -65,18 +65,18 @@ import org.apache.commons.logging.LogFactory; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.undertow.HttpHandlerFactory; import org.springframework.boot.undertow.UndertowWebServerFactory; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.Cookie.SameSite; -import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.MimeMappings.Mapping; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.ContextPath; import org.springframework.boot.web.server.servlet.CookieSameSiteSupplier; import org.springframework.boot.web.server.servlet.DocumentRoot; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.server.servlet.ServletContextInitializers; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerSettings; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactoryTests.java b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactoryTests.java index d8d78d186c..c79c4c9cd8 100644 --- a/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot-undertow/src/test/java/org/springframework/boot/undertow/servlet/UndertowServletWebServerFactoryTests.java @@ -51,7 +51,7 @@ import org.mockito.InOrder; import org.springframework.boot.testsupport.classpath.resources.WithPackageResources; import org.springframework.boot.testsupport.web.servlet.ExampleServlet; import org.springframework.boot.undertow.UndertowBuilderCustomizer; -import org.springframework.boot.web.server.ErrorPage; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.GracefulShutdownResult; import org.springframework.boot.web.server.PortInUseException; import org.springframework.boot.web.server.Shutdown; diff --git a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java index 27ecbd19db..0e23802ee1 100644 --- a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/WebFluxAutoConfigurationTests.java @@ -55,7 +55,7 @@ import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration; import org.springframework.boot.validation.autoconfigure.ValidatorAdapter; import org.springframework.boot.web.codec.CodecCustomizer; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfiguration.WebFluxConfig; import org.springframework.boot.webflux.autoconfigure.WebFluxAutoConfigurationTests.OrderedControllerAdviceBeansConfiguration.HighestOrderedControllerAdvice; diff --git a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerTests.java b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerTests.java index 69abfa9a3c..8b7cd23db7 100644 --- a/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerTests.java +++ b/spring-boot-project/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/error/DefaultErrorWebExceptionHandlerTests.java @@ -25,7 +25,7 @@ import reactor.core.publisher.Mono; import org.springframework.boot.autoconfigure.web.ErrorProperties; import org.springframework.boot.autoconfigure.web.WebProperties.Resources; import org.springframework.boot.testsupport.classpath.resources.WithResource; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.AnnotationConfigReactiveWebApplicationContext; import org.springframework.boot.webflux.error.ErrorAttributes; import org.springframework.context.ApplicationContext; import org.springframework.http.MediaType; diff --git a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java index 2190202070..e13b4c1ca0 100644 --- a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java @@ -48,9 +48,9 @@ import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.WebProperties; import org.springframework.boot.autoconfigure.web.WebProperties.Resources; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.server.ErrorPage; -import org.springframework.boot.web.server.ErrorPageRegistrar; -import org.springframework.boot.web.server.ErrorPageRegistry; +import org.springframework.boot.web.error.ErrorPage; +import org.springframework.boot.web.error.ErrorPageRegistrar; +import org.springframework.boot.web.error.ErrorPageRegistry; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; 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 0ae6138a5e..db694024d3 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 @@ -58,9 +58,9 @@ import org.springframework.boot.validation.autoconfigure.ValidatorAdapter; import org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; 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.context.AnnotationConfigServletWebServerApplicationContext; 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; diff --git a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WelcomePageIntegrationTests.java b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WelcomePageIntegrationTests.java index fc694c8f5f..64a99ef491 100644 --- a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WelcomePageIntegrationTests.java +++ b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/WelcomePageIntegrationTests.java @@ -27,8 +27,8 @@ import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.context.WebServerApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.context.WebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.RequestEntity; diff --git a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/RemappedErrorViewIntegrationTests.java b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/RemappedErrorViewIntegrationTests.java index c5fe867123..48884eccdc 100644 --- a/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/RemappedErrorViewIntegrationTests.java +++ b/spring-boot-project/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/RemappedErrorViewIntegrationTests.java @@ -26,9 +26,9 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; -import org.springframework.boot.web.server.ErrorPage; -import org.springframework.boot.web.server.ErrorPageRegistrar; -import org.springframework.boot.web.server.ErrorPageRegistry; +import org.springframework.boot.web.error.ErrorPage; +import org.springframework.boot.web.error.ErrorPageRegistrar; +import org.springframework.boot.web.error.ErrorPageRegistry; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-websocket/src/test/java/org/springframework/boot/websocket/autoconfigure/servlet/WebSocketMessagingAutoConfigurationTests.java b/spring-boot-project/spring-boot-websocket/src/test/java/org/springframework/boot/websocket/autoconfigure/servlet/WebSocketMessagingAutoConfigurationTests.java index 390df53120..2dad29c76a 100644 --- a/spring-boot-project/spring-boot-websocket/src/test/java/org/springframework/boot/websocket/autoconfigure/servlet/WebSocketMessagingAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-websocket/src/test/java/org/springframework/boot/websocket/autoconfigure/servlet/WebSocketMessagingAutoConfigurationTests.java @@ -44,7 +44,7 @@ import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.tomcat.autoconfigure.WebSocketTomcatWebServerFactoryCustomizer; import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebServerAutoConfiguration; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration; import org.springframework.boot.websocket.autoconfigure.servlet.WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index e39887e4e6..427009c37a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -61,14 +61,11 @@ import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.convert.ApplicationConversionService; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotatedBeanDefinitionReader; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigUtils; import org.springframework.context.annotation.ClassPathBeanDefinitionScanner; import org.springframework.context.annotation.ConfigurationClassPostProcessor; @@ -1223,11 +1220,9 @@ public class SpringApplication { /** * Sets the factory that will be called to create the application context. If not set, - * defaults to a factory that will create - * {@link AnnotationConfigServletWebServerApplicationContext} for servlet web - * applications, {@link AnnotationConfigReactiveWebServerApplicationContext} for - * reactive web applications, and {@link AnnotationConfigApplicationContext} for - * non-web applications. + * defaults to a factory that will create a context that is appropriate for the + * application's type (a reactive web application, a servlet web application, or a + * non-web application). * @param applicationContextFactory the factory for the context * @since 2.4.0 */ diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java index ea1469de29..c2662eeb1d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java @@ -29,7 +29,6 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationEvent; @@ -38,6 +37,7 @@ import org.springframework.context.EnvironmentAware; import org.springframework.context.event.GenericApplicationListener; import org.springframework.core.Ordered; import org.springframework.core.ResolvableType; +import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Environment; import org.springframework.core.env.StandardEnvironment; import org.springframework.util.Assert; @@ -63,8 +63,6 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext private boolean ready; - private boolean embeddedWebApplication; - public SpringApplicationAdminMXBeanRegistrar(String name) throws MalformedObjectNameException { this.objectName = new ObjectName(name); } @@ -87,8 +85,7 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext if (type == null) { return false; } - return ApplicationReadyEvent.class.isAssignableFrom(type) - || WebServerInitializedEvent.class.isAssignableFrom(type); + return ApplicationReadyEvent.class.isAssignableFrom(type); } @Override @@ -101,9 +98,6 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext if (event instanceof ApplicationReadyEvent readyEvent) { onApplicationReadyEvent(readyEvent); } - if (event instanceof WebServerInitializedEvent initializedEvent) { - onWebServerInitializedEvent(initializedEvent); - } } @Override @@ -117,12 +111,6 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext } } - void onWebServerInitializedEvent(WebServerInitializedEvent event) { - if (this.applicationContext.equals(event.getApplicationContext())) { - this.embeddedWebApplication = true; - } - } - @Override public void afterPropertiesSet() throws Exception { MBeanServer server = ManagementFactory.getPlatformMBeanServer(); @@ -146,7 +134,8 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext @Override public boolean isEmbeddedWebApplication() { - return SpringApplicationAdminMXBeanRegistrar.this.embeddedWebApplication; + return SpringApplicationAdminMXBeanRegistrar.this.environment instanceof ConfigurableEnvironment configurableEnvironment + && configurableEnvironment.getPropertySources().get("server.ports") != null; } @Override diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/AnnotationConfigReactiveWebApplicationContext.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/AnnotationConfigReactiveWebApplicationContext.java index 5646cb0e43..e73178c666 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/AnnotationConfigReactiveWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.annotation.AnnotationConfigApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ConfigurableReactiveWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ConfigurableReactiveWebApplicationContext.java similarity index 89% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ConfigurableReactiveWebApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ConfigurableReactiveWebApplicationContext.java index 0d08c19568..892ecffc29 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ConfigurableReactiveWebApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ConfigurableReactiveWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ConfigurableReactiveWebEnvironment.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ConfigurableReactiveWebEnvironment.java similarity index 89% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ConfigurableReactiveWebEnvironment.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ConfigurableReactiveWebEnvironment.java index f593f840f4..b7be3c89e6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ConfigurableReactiveWebEnvironment.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ConfigurableReactiveWebEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.core.env.ConfigurableEnvironment; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResource.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResource.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResource.java index e051d1d4a6..167ca21c5c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResourceFilePathResolver.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResourceFilePathResolver.java similarity index 95% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResourceFilePathResolver.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResourceFilePathResolver.java index 4494cd3562..6aae2fa7f0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResourceFilePathResolver.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResourceFilePathResolver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.boot.io.ApplicationResourceLoader; import org.springframework.boot.io.ApplicationResourceLoader.FilePathResolver; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/GenericReactiveWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/GenericReactiveWebApplicationContext.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/GenericReactiveWebApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/GenericReactiveWebApplicationContext.java index 6bd411e521..14e4a293fc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/GenericReactiveWebApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/GenericReactiveWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.support.GenericApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ReactiveWebApplicationContext.java similarity index 88% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ReactiveWebApplicationContext.java index 597d2598b9..c4358d5875 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/ReactiveWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/StandardReactiveWebEnvironment.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/StandardReactiveWebEnvironment.java similarity index 92% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/StandardReactiveWebEnvironment.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/StandardReactiveWebEnvironment.java index d1b2d9eb12..0c160eb95b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/StandardReactiveWebEnvironment.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/StandardReactiveWebEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.springframework.core.env.Environment; import org.springframework.core.env.MutablePropertySources; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/package-info.java similarity index 86% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/package-info.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/package-info.java index 80604f4eb7..d7609ff5cf 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/package-info.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/reactive/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -18,4 +18,4 @@ * Reactive based web integrations with Spring's * {@link org.springframework.context.ApplicationContext ApplicationContext}. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/AnnotationConfigServletWebApplicationContext.java similarity index 98% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/AnnotationConfigServletWebApplicationContext.java index a1aec8e8a3..93c7bf845b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/AnnotationConfigServletWebApplicationContext.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.context.servlet; import java.util.Arrays; import java.util.LinkedHashSet; @@ -40,7 +40,7 @@ import org.springframework.util.ObjectUtils; import org.springframework.web.context.support.GenericWebApplicationContext; /** - * {@link GenericWebApplicationContext}that accepts annotated classes as input - in + * {@link GenericWebApplicationContext} that accepts annotated classes as input - in * particular {@link Configuration @Configuration}-annotated classes, but also plain * {@link Component @Component} classes and JSR-330 compliant classes using * {@code javax.inject} annotations. Allows for registering classes one by one (specifying diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ApplicationServletEnvironment.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/ApplicationServletEnvironment.java similarity index 87% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ApplicationServletEnvironment.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/ApplicationServletEnvironment.java index 3cda2f4e61..cfa84b1fdf 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ApplicationServletEnvironment.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/ApplicationServletEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.context.servlet; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; @@ -27,8 +27,9 @@ import org.springframework.web.context.support.StandardServletEnvironment; * {@link SpringApplication}. * * @author Phillip Webb + * @since 4.0.0 */ -class ApplicationServletEnvironment extends StandardServletEnvironment { +public class ApplicationServletEnvironment extends StandardServletEnvironment { @Override protected String doGetActiveProfilesProperty() { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletContextResourceFilePathResolver.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/ServletContextResourceFilePathResolver.java similarity index 96% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletContextResourceFilePathResolver.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/ServletContextResourceFilePathResolver.java index b7945f5abf..de66037de2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletContextResourceFilePathResolver.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/ServletContextResourceFilePathResolver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.context.servlet; import org.springframework.boot.io.ApplicationResourceLoader; import org.springframework.boot.io.ApplicationResourceLoader.FilePathResolver; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/WebApplicationContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/WebApplicationContextInitializer.java new file mode 100644 index 0000000000..e63a61f4df --- /dev/null +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/WebApplicationContextInitializer.java @@ -0,0 +1,94 @@ +/* + * Copyright 2012-2025 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. + */ + +package org.springframework.boot.web.context.servlet; + +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.boot.web.servlet.ServletContextInitializer; +import org.springframework.boot.web.servlet.ServletContextInitializerBeans; +import org.springframework.web.context.ConfigurableWebApplicationContext; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.ServletContextScope; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Common initialization logic for Servlet web applications. + * + * @author Andy Wilkinson + * @since 4.0.0 + */ +public class WebApplicationContextInitializer { + + private static final Log logger = LogFactory.getLog(WebApplicationContextInitializer.class); + + private final ConfigurableWebApplicationContext context; + + public WebApplicationContextInitializer(ConfigurableWebApplicationContext context) { + this.context = context; + } + + public void initialize(ServletContext servletContext) throws ServletException { + prepareWebApplicationContext(servletContext); + registerApplicationScope(servletContext, this.context.getBeanFactory()); + WebApplicationContextUtils.registerEnvironmentBeans(this.context.getBeanFactory(), servletContext); + for (ServletContextInitializer initializerBean : new ServletContextInitializerBeans( + this.context.getBeanFactory())) { + initializerBean.onStartup(servletContext); + } + } + + private void prepareWebApplicationContext(ServletContext servletContext) { + Object rootContext = servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); + if (rootContext != null) { + if (rootContext == this) { + throw new IllegalStateException( + "Cannot initialize context because there is already a root application context present - " + + "check whether you have multiple ServletContextInitializers!"); + } + return; + } + try { + servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.context); + if (logger.isDebugEnabled()) { + logger.debug("Published root WebApplicationContext as ServletContext attribute with name [" + + WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE + "]"); + } + this.context.setServletContext(servletContext); + if (logger.isInfoEnabled()) { + long elapsedTime = System.currentTimeMillis() - this.context.getStartupDate(); + logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms"); + } + } + catch (RuntimeException | Error ex) { + logger.error("Context initialization failed", ex); + servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex); + throw ex; + } + } + + private void registerApplicationScope(ServletContext servletContext, ConfigurableListableBeanFactory beanFactory) { + ServletContextScope appScope = new ServletContextScope(servletContext); + beanFactory.registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope); + // Register as ServletContext attribute, for ContextCleanupListener to detect it. + servletContext.setAttribute(ServletContextScope.class.getName(), appScope); + } + +} diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/package-info.java similarity index 86% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/package-info.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/package-info.java index e7276f1852..d301e694ff 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/package-info.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/servlet/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -18,4 +18,4 @@ * Servlet based web integrations with Spring's * {@link org.springframework.web.context.WebApplicationContext WebApplicationContext}. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.context.servlet; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPage.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPage.java similarity index 96% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPage.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPage.java index 2971c5d208..905f10e3d8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPage.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server; +package org.springframework.boot.web.error; import org.springframework.http.HttpStatus; import org.springframework.util.ObjectUtils; @@ -24,7 +24,7 @@ import org.springframework.util.ObjectUtils; * {@literal <error-page>} element traditionally found in web.xml. * * @author Dave Syer - * @since 2.0.0 + * @since 4.0.0 */ public class ErrorPage { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistrar.java similarity index 88% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistrar.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistrar.java index 3f288ba18c..1b8fcb88b8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.web.server; +package org.springframework.boot.web.error; /** * Interface to be implemented by types that register {@link ErrorPage ErrorPages}. * * @author Phillip Webb - * @since 2.0.0 + * @since 4.0.0 */ @FunctionalInterface public interface ErrorPageRegistrar { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistrarBeanPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistrarBeanPostProcessor.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistrarBeanPostProcessor.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistrarBeanPostProcessor.java index 36ee8ec519..66f965d6d7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistrarBeanPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistrarBeanPostProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server; +package org.springframework.boot.web.error; import java.util.ArrayList; import java.util.Collection; @@ -35,7 +35,7 @@ import org.springframework.util.Assert; * * @author Phillip Webb * @author Stephane Nicoll - * @since 2.0.0 + * @since 4.0.0 */ public class ErrorPageRegistrarBeanPostProcessor implements BeanPostProcessor, BeanFactoryAware { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistry.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistry.java similarity index 88% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistry.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistry.java index 94c1efbdc4..9d175e626a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ErrorPageRegistry.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/error/ErrorPageRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.web.server; +package org.springframework.boot.web.error; /** * Interface for a registry that holds {@link ErrorPage ErrorPages}. * * @author Phillip Webb - * @since 2.0.0 + * @since 4.0.0 */ @FunctionalInterface public interface ErrorPageRegistry { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java index b0c50ceff4..9cab754cca 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import org.springframework.boot.ssl.SslBundle; import org.springframework.boot.ssl.SslBundles; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.Ssl.ServerNameSslBundle; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java index bc90e66b76..c30177f487 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -20,6 +20,8 @@ import java.net.InetAddress; import java.util.Set; import org.springframework.boot.ssl.SslBundles; +import org.springframework.boot.web.error.ErrorPage; +import org.springframework.boot.web.error.ErrorPageRegistry; /** * A configurable {@link WebServerFactory}. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ConfigurableWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java similarity index 92% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ConfigurableWebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java index 4366e906ca..9e3469a2ce 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ConfigurableWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java similarity index 95% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanException.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java index 5585fc49d4..95a68d5d5c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.WebApplicationType; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java similarity index 93% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java index d27cdd7861..6308505b94 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import java.util.Locale; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java index 80394628a0..0c7125e9b7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/ServerPortInfoApplicationContextInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import java.util.HashMap; import java.util.Map; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java similarity index 98% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java index 8ee894e8d7..42718ea0c8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.springframework.boot.web.server.WebServer; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java index 0a4f57515f..b3b82d2ddc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.springframework.boot.web.server.WebServer; import org.springframework.context.SmartLifecycle; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerInitializedEvent.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerInitializedEvent.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java index ed5850c5fa..0926660bfb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerInitializedEvent.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.springframework.boot.web.server.WebServer; import org.springframework.context.ApplicationEvent; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java similarity index 98% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java index 05f4c3a49d..a28a9db908 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerPortFileWriter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import java.io.File; import java.util.Locale; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/package-info.java similarity index 86% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/package-info.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/package-info.java index 6340e8692b..c50ef8f8ce 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/package-info.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -18,4 +18,4 @@ * Web integrations with Spring's {@link org.springframework.context.ApplicationContext * ApplicationContext}. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java similarity index 99% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java index a406991125..2d376b73db 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import java.util.Arrays; import java.util.LinkedHashSet; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ApplicationReactiveWebEnvironment.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java similarity index 87% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ApplicationReactiveWebEnvironment.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java index cf44fcad36..1f3f290394 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ApplicationReactiveWebEnvironment.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,10 +14,11 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; +import org.springframework.boot.web.context.reactive.StandardReactiveWebEnvironment; import org.springframework.core.env.ConfigurablePropertyResolver; import org.springframework.core.env.MutablePropertySources; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java similarity index 93% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java index 170f197ca9..1a5ed02eb3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java @@ -14,17 +14,18 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.boot.WebApplicationType; import org.springframework.boot.availability.AvailabilityChangeEvent; import org.springframework.boot.availability.ReadinessState; -import org.springframework.boot.web.context.ConfigurableWebServerApplicationContext; -import org.springframework.boot.web.context.MissingWebServerFactoryBeanException; -import org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle; +import org.springframework.boot.web.context.reactive.GenericReactiveWebApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.ConfigurableWebServerApplicationContext; +import org.springframework.boot.web.server.context.MissingWebServerFactoryBeanException; +import org.springframework.boot.web.server.context.WebServerGracefulShutdownLifecycle; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.ApplicationContextException; import org.springframework.core.metrics.StartupStep; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextFactory.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java index 146e9583e6..4e9f787523 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import org.springframework.aot.AotDetector; import org.springframework.boot.ApplicationContextFactory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerInitializedEvent.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java similarity index 86% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerInitializedEvent.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java index caa43f4293..7a7c7b51d6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerInitializedEvent.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 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. @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; -import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerInitializedEvent; /** * Event to be published after the {@link WebServer} is ready. Useful for obtaining the diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerManager.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java similarity index 98% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerManager.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java index 7c323271a1..28404a2d74 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerManager.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import java.util.function.Supplier; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java similarity index 91% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java index 28012ac63e..0e096b7741 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.SmartLifecycle; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java new file mode 100644 index 0000000000..9dbb30cc68 --- /dev/null +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2012-2025 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. + */ + +/** + * Reactive web server based integrations with Spring's + * {@link org.springframework.context.ApplicationContext ApplicationContext}. + */ +package org.springframework.boot.web.server.reactive.context; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java index 7af6ee8942..219030b664 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java @@ -28,6 +28,7 @@ import org.springframework.boot.web.server.ConfigurableWebServerFactory; import org.springframework.boot.web.server.Cookie.SameSite; import org.springframework.boot.web.server.MimeMappings; import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.servlet.ServletContextInitializer; /** * A configurable {@link ServletWebServerFactory}. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java index 3d3ec2144d..a2549e3d14 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java @@ -31,6 +31,7 @@ import jakarta.servlet.SessionCookieConfig; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.web.server.Cookie; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.servlet.ServletContextInitializer; /** * The {@link ServletContextInitializer ServletContextInitializers} to apply to a servlet diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java index bb63a7c053..9e2e99b0ea 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java @@ -18,6 +18,7 @@ package org.springframework.boot.web.server.servlet; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerFactory; +import org.springframework.boot.web.servlet.ServletContextInitializer; /** * Factory interface that can be used to create a {@link WebServer}. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java index 3ab3c3be9d..a00cafc773 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java @@ -30,6 +30,7 @@ import java.util.Set; import org.springframework.boot.web.server.MimeMappings; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.util.Assert; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java similarity index 89% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java index d6e8ed44ca..a9f15ce649 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java @@ -14,12 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet; import jakarta.servlet.annotation.WebListener; -import org.springframework.boot.web.server.servlet.WebListenerRegistry; - /** * Interface to be implemented by types that register {@link WebListener @WebListeners}. * diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java similarity index 98% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java index aedfd636e6..dd862ee4de 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import java.util.Arrays; import java.util.LinkedHashSet; @@ -51,7 +51,6 @@ import org.springframework.util.ClassUtils; * @see #register(Class...) * @see #scan(String...) * @see ServletWebServerApplicationContext - * @see AnnotationConfigServletWebApplicationContext */ public class AnnotationConfigServletWebServerApplicationContext extends ServletWebServerApplicationContext implements AnnotationConfigRegistry { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java index 5f0e6ad55c..4bd80b1ec3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.lang.annotation.Annotation; import java.util.HashMap; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java index 646b02aebb..13a26ba446 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentRegisteringPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.util.ArrayList; import java.util.Collections; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java similarity index 95% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java index 1da66cc579..94091d87ab 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScan.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java index 650d39922f..15fd9d58d6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.util.Arrays; import java.util.Collection; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java similarity index 75% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java index b5254a1061..291630e4c7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java @@ -14,11 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; -import java.util.Collection; import java.util.Collections; -import java.util.EventListener; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; @@ -39,27 +37,25 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.boot.WebApplicationType; import org.springframework.boot.availability.AvailabilityChangeEvent; import org.springframework.boot.availability.ReadinessState; -import org.springframework.boot.web.context.ConfigurableWebServerApplicationContext; -import org.springframework.boot.web.context.MissingWebServerFactoryBeanException; -import org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle; +import org.springframework.boot.web.context.servlet.WebApplicationContextInitializer; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; +import org.springframework.boot.web.server.context.ConfigurableWebServerApplicationContext; +import org.springframework.boot.web.server.context.MissingWebServerFactoryBeanException; +import org.springframework.boot.web.server.context.WebServerGracefulShutdownLifecycle; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.boot.web.servlet.ServletContextInitializerBeans; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextException; import org.springframework.core.io.Resource; import org.springframework.core.metrics.StartupStep; import org.springframework.util.StringUtils; -import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.ServletContextAware; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.GenericWebApplicationContext; import org.springframework.web.context.support.ServletContextAwareProcessor; import org.springframework.web.context.support.ServletContextResource; -import org.springframework.web.context.support.ServletContextScope; import org.springframework.web.context.support.WebApplicationContextUtils; /** @@ -234,24 +230,8 @@ public class ServletWebServerApplicationContext extends GenericWebApplicationCon * @return the self initializer * @see #prepareWebApplicationContext(ServletContext) */ - private org.springframework.boot.web.server.servlet.ServletContextInitializer getSelfInitializer() { - return this::selfInitialize; - } - - private void selfInitialize(ServletContext servletContext) throws ServletException { - prepareWebApplicationContext(servletContext); - registerApplicationScope(servletContext); - WebApplicationContextUtils.registerEnvironmentBeans(getBeanFactory(), servletContext); - for (ServletContextInitializer initializerBean : getServletContextInitializerBeans()) { - initializerBean.onStartup(servletContext); - } - } - - private void registerApplicationScope(ServletContext servletContext) { - ServletContextScope appScope = new ServletContextScope(servletContext); - getBeanFactory().registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope); - // Register as ServletContext attribute, for ContextCleanupListener to detect it. - servletContext.setAttribute(ServletContextScope.class.getName(), appScope); + private org.springframework.boot.web.servlet.ServletContextInitializer getSelfInitializer() { + return new WebApplicationContextInitializer(this)::initialize; } private void registerWebApplicationScopes() { @@ -260,54 +240,6 @@ public class ServletWebServerApplicationContext extends GenericWebApplicationCon existingScopes.restore(); } - /** - * Returns {@link ServletContextInitializer}s that should be used with the embedded - * web server. By default this method will first attempt to find - * {@link ServletContextInitializer}, {@link Servlet}, {@link Filter} and certain - * {@link EventListener} beans. - * @return the servlet initializer beans - */ - protected Collection getServletContextInitializerBeans() { - return new ServletContextInitializerBeans(getBeanFactory()); - } - - /** - * Prepare the {@link WebApplicationContext} with the given fully loaded - * {@link ServletContext}. This method is usually called from - * {@link ServletContextInitializer#onStartup(ServletContext)} and is similar to the - * functionality usually provided by a {@link ContextLoaderListener}. - * @param servletContext the operational servlet context - */ - protected void prepareWebApplicationContext(ServletContext servletContext) { - Object rootContext = servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); - if (rootContext != null) { - if (rootContext == this) { - throw new IllegalStateException( - "Cannot initialize context because there is already a root application context present - " - + "check whether you have multiple ServletContextInitializers!"); - } - return; - } - servletContext.log("Initializing Spring embedded WebApplicationContext"); - try { - servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this); - if (logger.isDebugEnabled()) { - logger.debug("Published root WebApplicationContext as ServletContext attribute with name [" - + WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE + "]"); - } - setServletContext(servletContext); - if (logger.isInfoEnabled()) { - long elapsedTime = System.currentTimeMillis() - getStartupDate(); - logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms"); - } - } - catch (RuntimeException | Error ex) { - logger.error("Context initialization failed", ex); - servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex); - throw ex; - } - } - @Override protected Resource getResourceByPath(String path) { if (getServletContext() == null) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java similarity index 91% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextFactory.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java index 7e4a7538d1..5c9b5d2384 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,11 +14,12 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import org.springframework.aot.AotDetector; import org.springframework.boot.ApplicationContextFactory; import org.springframework.boot.WebApplicationType; +import org.springframework.boot.web.context.servlet.ApplicationServletEnvironment; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.env.ConfigurableEnvironment; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerInitializedEvent.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java similarity index 89% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerInitializedEvent.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java index 81bedb636c..77cff90ab5 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerInitializedEvent.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 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. @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; -import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerInitializedEvent; /** * Event to be published after the {@link WebServer} is ready. Useful for obtaining the diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java index 9e75cc6c34..4eb705feff 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebApplicationContextServletContextAwareProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java similarity index 93% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java index 73544147fb..842013a732 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebFilterHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.util.Arrays; import java.util.EnumSet; @@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.util.StringUtils; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java similarity index 93% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java index 868a431a76..c606fc4dfc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebListenerHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.util.Map; @@ -23,6 +23,7 @@ import jakarta.servlet.annotation.WebListener; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.boot.web.server.servlet.WebListenerRegistrar; import org.springframework.boot.web.server.servlet.WebListenerRegistry; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java similarity index 92% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java index 05c4518442..c3f5d6ef24 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; -import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.WebServerApplicationContext; import org.springframework.context.SmartLifecycle; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java similarity index 94% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java index 40f2c06f74..1015a7d0ba 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/WebServletHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.util.Map; @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.util.StringUtils; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContext.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java index 64cae458e5..bce776c3a1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.core.env.ConfigurableEnvironment; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java new file mode 100644 index 0000000000..fc9310ab7e --- /dev/null +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2012-2025 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. + */ + +/** + * Servlet web server based web integrations with Spring's + * {@link org.springframework.web.context.WebApplicationContext WebApplicationContext}. + */ +package org.springframework.boot.web.server.servlet.context; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java index c81147937c..2ca818bdfb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java @@ -29,7 +29,6 @@ import jakarta.servlet.FilterRegistration; import jakarta.servlet.FilterRegistration.Dynamic; import jakarta.servlet.ServletContext; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java index 061a50c58a..6772c58c28 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBean.java @@ -21,7 +21,6 @@ import jakarta.servlet.ServletContext; import jakarta.servlet.ServletException; import org.springframework.beans.BeansException; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.util.Assert; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java index f87630f349..977a7312fe 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java @@ -19,7 +19,6 @@ package org.springframework.boot.web.servlet; import jakarta.servlet.Filter; import jakarta.servlet.ServletContext; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.util.Assert; /** diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java index 4a72d87728..1af6545b75 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/RegistrationBean.java @@ -21,7 +21,6 @@ import jakarta.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.core.Ordered; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java similarity index 97% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializer.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java index 86b618f878..62c96d878f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.servlet; +package org.springframework.boot.web.servlet; import jakarta.servlet.ServletContainerInitializer; import jakarta.servlet.ServletContext; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java index 2a02ecb896..195a707cd0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java @@ -42,7 +42,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.aop.scope.ScopedProxyUtils; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.core.Ordered; import org.springframework.core.annotation.AnnotationAwareOrderComparator; import org.springframework.core.annotation.Order; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java index f82004b629..c7bed435cb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java @@ -30,7 +30,6 @@ import jakarta.servlet.http.HttpSessionAttributeListener; import jakarta.servlet.http.HttpSessionIdListener; import jakarta.servlet.http.HttpSessionListener; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java index 1b12c3c134..616d60ddfd 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java @@ -26,7 +26,6 @@ import jakarta.servlet.Servlet; import jakarta.servlet.ServletContext; import jakarta.servlet.ServletRegistration; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java index b70dff0ddb..802cf4d1f1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java @@ -38,9 +38,9 @@ import jakarta.servlet.http.HttpServletResponseWrapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.web.server.ErrorPage; -import org.springframework.boot.web.server.ErrorPageRegistrar; -import org.springframework.boot.web.server.ErrorPageRegistry; +import org.springframework.boot.web.error.ErrorPage; +import org.springframework.boot.web.error.ErrorPageRegistrar; +import org.springframework.boot.web.error.ErrorPageRegistry; import org.springframework.core.Ordered; import org.springframework.util.ClassUtils; import org.springframework.web.filter.OncePerRequestFilter; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java index c8a8b84227..7203aa28ae 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java @@ -30,15 +30,20 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import reactor.core.scheduler.Schedulers; +import org.springframework.boot.ApplicationContextFactory; import org.springframework.boot.SpringApplication; +import org.springframework.boot.WebApplicationType; import org.springframework.boot.builder.ParentContextApplicationContextInitializer; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.context.logging.LoggingApplicationListener; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.ApplicationServletEnvironment; +import org.springframework.boot.web.context.servlet.WebApplicationContextInitializer; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; +import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.MergedAnnotations; @@ -155,7 +160,7 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit builder.initializers(new ParentContextApplicationContextInitializer(parent)); } builder.initializers(new ServletContextApplicationContextInitializer(servletContext)); - builder.contextFactory((webApplicationType) -> new AnnotationConfigServletWebServerApplicationContext()); + builder.contextFactory(new WarDeploymentApplicationContextFactory(servletContext)); builder = configure(builder); builder.listeners(new WebEnvironmentPropertySourceInitializer(servletContext)); SpringApplication application = builder.build(); @@ -277,4 +282,38 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit } + private static final class WarDeploymentApplicationContextFactory implements ApplicationContextFactory { + + private final ServletContext servletContext; + + private WarDeploymentApplicationContextFactory(ServletContext servletContext) { + this.servletContext = servletContext; + } + + @Override + public ConfigurableApplicationContext create(WebApplicationType webApplicationType) { + return new AnnotationConfigServletWebApplicationContext() { + + @Override + protected void onRefresh() { + super.onRefresh(); + try { + new WebApplicationContextInitializer(this) + .initialize(WarDeploymentApplicationContextFactory.this.servletContext); + } + catch (ServletException ex) { + throw new RuntimeException(ex); + } + } + + }; + } + + @Override + public ConfigurableEnvironment createEnvironment(WebApplicationType webApplicationType) { + return new ApplicationServletEnvironment(); + } + + } + } diff --git a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories index 3bfb7e3d3e..9e442ab7a0 100644 --- a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories @@ -23,8 +23,8 @@ org.springframework.boot.context.config.SystemEnvironmentConfigDataLoader # Application Context Factories org.springframework.boot.ApplicationContextFactory=\ -org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContextFactory,\ -org.springframework.boot.web.servlet.context.ServletWebServerApplicationContextFactory +org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContextFactory,\ +org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContextFactory # Run Listeners org.springframework.boot.SpringApplicationRunListener=\ @@ -39,7 +39,7 @@ org.springframework.context.ApplicationContextInitializer=\ org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer,\ org.springframework.boot.context.ContextIdApplicationContextInitializer,\ org.springframework.boot.io.ProtocolResolverApplicationContextInitializer,\ -org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer +org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer # Application Listeners org.springframework.context.ApplicationListener=\ @@ -78,7 +78,8 @@ org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnaly org.springframework.boot.diagnostics.analyzer.PatternParseFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.UnboundConfigurationPropertyFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer,\ -org.springframework.boot.web.context.MissingWebServerFactoryBeanFailureAnalyzer +org.springframework.boot.web.server.PortInUseFailureAnalyzer,\ +org.springframework.boot.web.server.context.MissingWebServerFactoryBeanFailureAnalyzer # Failure Analysis Reporters org.springframework.boot.diagnostics.FailureAnalysisReporter=\ @@ -91,5 +92,5 @@ org.springframework.boot.io.Base64ProtocolResolver # Resource File Path Resolvers org.springframework.boot.io.ApplicationResourceLoader$FilePathResolver=\ org.springframework.boot.io.ClassPathResourceFilePathResolver,\ -org.springframework.boot.web.context.ServletContextResourceFilePathResolver,\ -org.springframework.boot.web.reactive.context.FilteredReactiveWebContextResourceFilePathResolver +org.springframework.boot.web.context.reactive.FilteredReactiveWebContextResourceFilePathResolver,\ +org.springframework.boot.web.context.servlet.ServletContextResourceFilePathResolver diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 33888561a5..2a3e176afc 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -76,12 +76,12 @@ import org.springframework.boot.testsupport.classpath.ForkedClassPath; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; -import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; -import org.springframework.boot.web.reactive.context.StandardReactiveWebEnvironment; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.StandardReactiveWebEnvironment; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextException; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java similarity index 94% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java index 1a70d38846..f079ddf32c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/reactive/FilteredReactiveWebContextResourceFilePathResolverIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import java.io.File; @@ -51,7 +51,7 @@ class FilteredReactiveWebContextResourceFilePathResolverIntegrationTests { .get(new AnnotationConfigReactiveWebApplicationContext(), false); Resource resource = resourceLoader.getResource("src/main/resources/a-file"); assertThat(resource).isInstanceOf(ClassUtils.resolveClassName( - "org.springframework.boot.web.reactive.context.FilteredReactiveWebContextResource", null)); + "org.springframework.boot.web.context.reactive.FilteredReactiveWebContextResource", null)); } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/GenericReactiveWebApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/reactive/GenericReactiveWebApplicationContextTests.java similarity index 91% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/GenericReactiveWebApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/reactive/GenericReactiveWebApplicationContextTests.java index bd4ce645c9..416a7c0a17 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/GenericReactiveWebApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/reactive/GenericReactiveWebApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.context.reactive; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletContextResourceFilePathResolverIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/servlet/ServletContextResourceFilePathResolverIntegrationTests.java similarity index 97% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletContextResourceFilePathResolverIntegrationTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/servlet/ServletContextResourceFilePathResolverIntegrationTests.java index ab110a6068..bff134cacf 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletContextResourceFilePathResolverIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/servlet/ServletContextResourceFilePathResolverIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.context.servlet; import java.io.File; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java similarity index 92% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java index d9ad1217c0..5de6468061 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.junit.jupiter.api.Test; import org.springframework.boot.diagnostics.FailureAnalysis; -import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; +import org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContextException; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java similarity index 94% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java index 5325bd2a10..2eeb9b56dc 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java similarity index 98% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java index 95addcccdd..8a562264af 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.context; +package org.springframework.boot.web.server.context; import java.io.File; import java.util.HashSet; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java similarity index 94% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java index 998d40cb63..bceb33b90e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import org.junit.jupiter.api.Test; -import org.springframework.boot.web.reactive.context.WebServerManager.DelayedInitializationHttpHandler; -import org.springframework.boot.web.reactive.context.config.ExampleReactiveWebServerApplicationConfiguration; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; +import org.springframework.boot.web.server.reactive.context.WebServerManager.DelayedInitializationHttpHandler; +import org.springframework.boot.web.server.reactive.context.config.ExampleReactiveWebServerApplicationConfiguration; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ApplicationReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java similarity index 89% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ApplicationReactiveWebEnvironmentTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java index 1309ff6a28..0c2b702864 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ApplicationReactiveWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import org.springframework.boot.AbstractApplicationEnvironmentTests; import org.springframework.core.env.StandardEnvironment; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java similarity index 98% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java index 98ccb0d6a0..81029a9643 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context; +package org.springframework.boot.web.server.reactive.context; import java.util.ArrayDeque; import java.util.ArrayList; @@ -28,8 +28,8 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.boot.availability.AvailabilityChangeEvent; import org.springframework.boot.availability.ReadinessState; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.context.ApplicationContextException; import org.springframework.context.ApplicationEvent; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java index 66235adb10..5d8d57ffb7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.reactive.context.config; +package org.springframework.boot.web.server.reactive.context.config; import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java similarity index 97% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java index 3dd50d2fec..ca75551deb 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import jakarta.servlet.GenericServlet; import jakarta.servlet.Servlet; @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.servlet.context.config.ExampleServletWebServerApplicationConfiguration; +import org.springframework.boot.web.server.servlet.context.config.ExampleServletWebServerApplicationConfiguration; import org.springframework.boot.web.servlet.mock.MockServlet; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ApplicationServletEnvironmentTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java similarity index 83% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ApplicationServletEnvironmentTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java index a773e75cdb..af3d1c2947 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ApplicationServletEnvironmentTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -14,9 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import org.springframework.boot.AbstractApplicationEnvironmentTests; +import org.springframework.boot.web.context.servlet.ApplicationServletEnvironment; import org.springframework.core.env.StandardEnvironment; /** diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MockWebEnvironmentServletComponentScanIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java similarity index 86% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MockWebEnvironmentServletComponentScanIntegrationTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java index aaf0889ea6..619029f9c0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MockWebEnvironmentServletComponentScanIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.io.File; import java.io.FileWriter; @@ -33,12 +33,15 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.springframework.boot.testsupport.classpath.ForkedClassPath; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.server.servlet.WebListenerRegistrar; import org.springframework.boot.web.server.servlet.WebListenerRegistry; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebApplicationContext; -import org.springframework.boot.web.servlet.testcomponents.filter.TestFilter; -import org.springframework.boot.web.servlet.testcomponents.listener.TestListener; -import org.springframework.boot.web.servlet.testcomponents.servlet.TestMultipartServlet; -import org.springframework.boot.web.servlet.testcomponents.servlet.TestServlet; +import org.springframework.boot.web.server.servlet.context.testcomponents.filter.TestFilter; +import org.springframework.boot.web.server.servlet.context.testcomponents.listener.TestListener; +import org.springframework.boot.web.server.servlet.context.testcomponents.servlet.TestMultipartServlet; +import org.springframework.boot.web.server.servlet.context.testcomponents.servlet.TestServlet; +import org.springframework.boot.web.servlet.RegistrationBean; +import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.mock.web.MockServletContext; import static org.assertj.core.api.Assertions.assertThat; @@ -133,7 +136,7 @@ class MockWebEnvironmentServletComponentScanIntegrationTests { this.context.setServletContext(new MockServletContext()); } - @ServletComponentScan(basePackages = "org.springframework.boot.web.servlet.testcomponents") + @ServletComponentScan(basePackages = "org.springframework.boot.web.server.servlet.context.testcomponents") static class ScanningConfiguration { } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java similarity index 89% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java index f2e2711eb2..b5a1607a5c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.io.File; import java.io.FileWriter; @@ -36,11 +36,12 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; import org.springframework.boot.web.server.servlet.ServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.testcomponents.filter.TestFilter; -import org.springframework.boot.web.servlet.testcomponents.listener.TestListener; -import org.springframework.boot.web.servlet.testcomponents.servlet.TestMultipartServlet; -import org.springframework.boot.web.servlet.testcomponents.servlet.TestServlet; +import org.springframework.boot.web.server.servlet.WebListenerRegistrar; +import org.springframework.boot.web.server.servlet.context.testcomponents.filter.TestFilter; +import org.springframework.boot.web.server.servlet.context.testcomponents.listener.TestListener; +import org.springframework.boot.web.server.servlet.context.testcomponents.servlet.TestMultipartServlet; +import org.springframework.boot.web.server.servlet.context.testcomponents.servlet.TestServlet; +import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; import static org.assertj.core.api.Assertions.assertThat; @@ -124,7 +125,7 @@ class ServletComponentScanIntegrationTests { } } - @ServletComponentScan(basePackages = "org.springframework.boot.web.servlet.testcomponents") + @ServletComponentScan(basePackages = "org.springframework.boot.web.server.servlet.context.testcomponents") static class TestConfiguration { @Bean diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java similarity index 92% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java index c829ac8e33..c113834856 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.util.function.Consumer; @@ -25,8 +25,7 @@ import org.springframework.aot.hint.MemberCategory; import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.aot.test.generate.TestGenerationContext; import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; -import org.springframework.boot.web.servlet.testcomponents.listener.TestListener; +import org.springframework.boot.web.server.servlet.context.testcomponents.listener.TestListener; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Configuration; @@ -114,7 +113,8 @@ class ServletComponentScanRegistrarTests { this.context = new AnnotationConfigApplicationContext(NoBasePackages.class); ServletComponentRegisteringPostProcessor postProcessor = this.context .getBean(ServletComponentRegisteringPostProcessor.class); - assertThat(postProcessor.getPackagesToScan()).containsExactly("org.springframework.boot.web.servlet"); + assertThat(postProcessor.getPackagesToScan()) + .containsExactly("org.springframework.boot.web.server.servlet.context"); } @Test @@ -122,8 +122,8 @@ class ServletComponentScanRegistrarTests { this.context = new AnnotationConfigApplicationContext(NoBasePackages.class, BasePackages.class); ServletComponentRegisteringPostProcessor postProcessor = this.context .getBean(ServletComponentRegisteringPostProcessor.class); - assertThat(postProcessor.getPackagesToScan()).containsExactlyInAnyOrder("org.springframework.boot.web.servlet", - "com.example.foo", "com.example.bar"); + assertThat(postProcessor.getPackagesToScan()).containsExactlyInAnyOrder( + "org.springframework.boot.web.server.servlet.context", "com.example.foo", "com.example.bar"); } @Test @@ -131,8 +131,8 @@ class ServletComponentScanRegistrarTests { this.context = new AnnotationConfigApplicationContext(BasePackages.class, NoBasePackages.class); ServletComponentRegisteringPostProcessor postProcessor = this.context .getBean(ServletComponentRegisteringPostProcessor.class); - assertThat(postProcessor.getPackagesToScan()).containsExactlyInAnyOrder("org.springframework.boot.web.servlet", - "com.example.foo", "com.example.bar"); + assertThat(postProcessor.getPackagesToScan()).containsExactlyInAnyOrder( + "org.springframework.boot.web.server.servlet.context", "com.example.foo", "com.example.bar"); } @Test @@ -221,13 +221,13 @@ class ServletComponentScanRegistrarTests { } @Configuration(proxyBeanMethods = false) - @ServletComponentScan("org.springframework.boot.web.servlet.testcomponents.listener") + @ServletComponentScan("org.springframework.boot.web.server.servlet.context.testcomponents.listener") static class ScanListenerPackage { } @Configuration(proxyBeanMethods = false) - @ServletComponentScan("org.springframework.boot.web.servlet.testcomponents.servlet") + @ServletComponentScan("org.springframework.boot.web.server.servlet.context.testcomponents.servlet") static class ScanServletPackage { } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java similarity index 99% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java index a784bcd79c..3f41c73c6b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import java.util.ArrayDeque; import java.util.ArrayList; @@ -50,12 +50,12 @@ import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.boot.availability.AvailabilityChangeEvent; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; -import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean; import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.ApplicationContextException; import org.springframework.context.ApplicationEvent; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java similarity index 99% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java index d797f1fab4..28bbb45934 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.io.IOException; import java.util.EnumSet; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java similarity index 95% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java index 02d1b15ef3..e889ef0b01 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebListenerHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.io.IOException; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java similarity index 99% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java index 4bfee967d7..5d9275f328 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet; +package org.springframework.boot.web.server.servlet.context; import java.io.IOException; import java.util.Map; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java similarity index 97% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java index c5fb187266..d75b0ff76b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/XmlServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context; +package org.springframework.boot.web.server.servlet.context; import jakarta.servlet.Servlet; import org.junit.jupiter.api.Test; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java similarity index 95% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java index e41963e782..f33c4d5255 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.context.config; +package org.springframework.boot.web.server.servlet.context.config; import jakarta.servlet.Servlet; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/filter/TestFilter.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java similarity index 90% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/filter/TestFilter.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java index 38e30ff931..f8e73d5806 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/filter/TestFilter.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.testcomponents.filter; +package org.springframework.boot.web.server.servlet.context.testcomponents.filter; import java.io.IOException; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/listener/TestListener.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java similarity index 92% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/listener/TestListener.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java index 48e2d01716..570f5a824e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/listener/TestListener.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.testcomponents.listener; +package org.springframework.boot.web.server.servlet.context.testcomponents.listener; import java.io.IOException; import java.util.EnumSet; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/servlet/TestMultipartServlet.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java similarity index 86% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/servlet/TestMultipartServlet.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java index 3669b8438d..4a0b1b2604 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/servlet/TestMultipartServlet.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.testcomponents.servlet; +package org.springframework.boot.web.server.servlet.context.testcomponents.servlet; import jakarta.servlet.annotation.MultipartConfig; import jakarta.servlet.annotation.WebServlet; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/servlet/TestServlet.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java similarity index 90% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/servlet/TestServlet.java rename to spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java index 24a230c6d2..a9a8e224e7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/servlet/TestServlet.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.servlet.testcomponents.servlet; +package org.springframework.boot.web.server.servlet.context.testcomponents.servlet; import java.io.IOException; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java index 19eebb3cd3..4ff6e4648e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java @@ -21,7 +21,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.mock.MockFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java index 4b276204ab..c1cafa0c47 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java @@ -36,7 +36,6 @@ import jakarta.servlet.http.HttpSessionIdListener; import org.assertj.core.api.ThrowingConsumer; import org.junit.jupiter.api.Test; -import org.springframework.boot.web.server.servlet.ServletContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java index 65601ab149..d2c46c2160 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 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. @@ -35,7 +35,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; -import org.springframework.boot.web.server.ErrorPage; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.http.HttpStatus; import org.springframework.mock.web.MockFilterChain; import org.springframework.mock.web.MockFilterConfig; diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml b/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml rename to spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java index e53db1d0d0..0cf0f47a29 100644 --- a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java @@ -130,9 +130,9 @@ import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; import org.springframework.boot.testsupport.web.servlet.ExampleFilter; import org.springframework.boot.testsupport.web.servlet.ExampleServlet; +import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.server.Compression; import org.springframework.boot.web.server.Cookie.SameSite; -import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.GracefulShutdownResult; import org.springframework.boot.web.server.Http2; import org.springframework.boot.web.server.MimeMappings; @@ -144,6 +144,7 @@ import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.WebServerException; import org.springframework.boot.web.server.servlet.Session.SessionTrackingMode; import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java index 2d41cb87fc..829a62eb3f 100644 --- a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java +++ b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java @@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.testsupport.classpath.ForkedClassPath; import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories; import org.springframework.boot.web.server.WebServer; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; -import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java index 1772d8f392..b96be127b0 100644 --- a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java @@ -22,6 +22,7 @@ import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory; import org.springframework.boot.web.server.WebServer; import org.springframework.boot.web.server.servlet.MockServletWebServer.RegisteredFilter; import org.springframework.boot.web.server.servlet.MockServletWebServer.RegisteredServlet; +import org.springframework.boot.web.servlet.ServletContextInitializer; import static org.mockito.Mockito.spy; diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java index e165edd781..d28e8c833f 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/spring-boot-server-tests-app/src/main/java/com/example/ResourceHandlingApplication.java @@ -28,7 +28,7 @@ import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.context.WebServerPortFileWriter; +import org.springframework.boot.web.server.context.WebServerPortFileWriter; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java index d55fd9e66a..23fcaab54e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/src/test/java/smoketest/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java @@ -28,8 +28,8 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.tomcat.TomcatWebServer; -import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.server.AbstractConfigurableWebServerFactory; +import org.springframework.boot.web.server.context.WebServerInitializedEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java index 4cd55680d6..7d8151eec0 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/SampleTomcatApplicationTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.tomcat.TomcatWebServer; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java index eda928f578..baefa32c0a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat11/src/test/java/smoketest/tomcat/SampleTomcat11ApplicationTests.java @@ -34,7 +34,7 @@ import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.tomcat.TomcatWebServer; -import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/SampleWebApplicationTypeApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/SampleWebApplicationTypeApplicationTests.java index a3fabb10ef..fdf924b986 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/SampleWebApplicationTypeApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/SampleWebApplicationTypeApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.context.ApplicationContext; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/WebEnvironmentNoneOverridesWebApplicationTypeTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/WebEnvironmentNoneOverridesWebApplicationTypeTests.java index c3275a9944..7b5ac5cb9a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/WebEnvironmentNoneOverridesWebApplicationTypeTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-application-type/src/test/java/smoketest/webapplicationtype/WebEnvironmentNoneOverridesWebApplicationTypeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 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. @@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.web.context.WebApplicationContext; diff --git a/src/checkstyle/import-control.xml b/src/checkstyle/import-control.xml index 24dda45472..c754021e8e 100644 --- a/src/checkstyle/import-control.xml +++ b/src/checkstyle/import-control.xml @@ -21,17 +21,11 @@ - - - - - - - + @@ -115,66 +109,50 @@ + + + + + + + - + + - - - - - - - - - + + + + - - + + - - - - - - - - - + + - - - - - - - - - - - - - + + - @@ -189,16 +167,10 @@ - - - - - -