Replace usage of WebMvcConfigurerAdapter
Closes gh-8964
This commit is contained in:
@@ -39,7 +39,7 @@ import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
|
||||
import org.springframework.data.neo4j.web.support.OpenSessionInViewInterceptor;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data Neo4j.
|
||||
@@ -108,14 +108,14 @@ public class Neo4jDataAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnWebApplication(type = Type.SERVLET)
|
||||
@ConditionalOnClass({ WebMvcConfigurerAdapter.class,
|
||||
@ConditionalOnClass({ WebMvcConfigurer.class,
|
||||
OpenSessionInViewInterceptor.class })
|
||||
@ConditionalOnMissingBean(OpenSessionInViewInterceptor.class)
|
||||
@ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view", havingValue = "true", matchIfMissing = true)
|
||||
protected static class Neo4jWebConfiguration {
|
||||
|
||||
@Configuration
|
||||
protected static class Neo4jWebMvcConfiguration extends WebMvcConfigurerAdapter {
|
||||
protected static class Neo4jWebMvcConfiguration implements WebMvcConfigurer {
|
||||
|
||||
@Bean
|
||||
public OpenSessionInViewInterceptor neo4jOpenSessionInViewInterceptor() {
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoCon
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
|
||||
import org.springframework.data.web.config.EnableSpringDataWebSupport;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's web support.
|
||||
@@ -41,7 +41,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
||||
@EnableSpringDataWebSupport
|
||||
@ConditionalOnWebApplication(type = Type.SERVLET)
|
||||
@ConditionalOnClass({ PageableHandlerMethodArgumentResolver.class,
|
||||
WebMvcConfigurerAdapter.class })
|
||||
WebMvcConfigurer.class })
|
||||
@ConditionalOnMissingBean(PageableHandlerMethodArgumentResolver.class)
|
||||
@AutoConfigureAfter(RepositoryRestMvcAutoConfiguration.class)
|
||||
public class SpringDataWebAutoConfiguration {
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.mobile.device.DeviceResolver;
|
||||
import org.springframework.mobile.device.DeviceResolverHandlerInterceptor;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Mobile's
|
||||
@@ -62,7 +62,7 @@ public class DeviceResolverAutoConfiguration {
|
||||
@Configuration
|
||||
@Order(0)
|
||||
protected static class DeviceResolverMvcConfiguration
|
||||
extends WebMvcConfigurerAdapter {
|
||||
implements WebMvcConfigurer {
|
||||
|
||||
private DeviceResolverHandlerInterceptor deviceResolverHandlerInterceptor;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.mobile.device.site.SitePreferenceHandlerInterceptor;
|
||||
import org.springframework.mobile.device.site.SitePreferenceHandlerMethodArgumentResolver;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Mobile's
|
||||
@@ -64,7 +64,7 @@ public class SitePreferenceAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
protected static class SitePreferenceMvcConfiguration
|
||||
extends WebMvcConfigurerAdapter {
|
||||
implements WebMvcConfigurer {
|
||||
|
||||
private final SitePreferenceHandlerInterceptor sitePreferenceHandlerInterceptor;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* Base {@link EnableAutoConfiguration Auto-configuration} for JPA.
|
||||
@@ -197,7 +197,7 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnWebApplication(type = Type.SERVLET)
|
||||
@ConditionalOnClass(WebMvcConfigurerAdapter.class)
|
||||
@ConditionalOnClass(WebMvcConfigurer.class)
|
||||
@ConditionalOnMissingBean({ OpenEntityManagerInViewInterceptor.class,
|
||||
OpenEntityManagerInViewFilter.class })
|
||||
@ConditionalOnProperty(prefix = "spring.jpa", name = "open-in-view", havingValue = "true", matchIfMissing = true)
|
||||
@@ -206,7 +206,7 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware {
|
||||
// Defined as a nested config to ensure WebMvcConfigurerAdapter is not read when
|
||||
// not on the classpath
|
||||
@Configuration
|
||||
protected static class JpaWebMvcConfiguration extends WebMvcConfigurerAdapter {
|
||||
protected static class JpaWebMvcConfiguration implements WebMvcConfigurer {
|
||||
|
||||
@Bean
|
||||
public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Security OAuth2.
|
||||
@@ -40,7 +40,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
||||
* @since 1.3.0
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({ OAuth2AccessToken.class, WebMvcConfigurerAdapter.class })
|
||||
@ConditionalOnClass({ OAuth2AccessToken.class, WebMvcConfigurer.class })
|
||||
@Import({ OAuth2AuthorizationServerConfiguration.class,
|
||||
OAuth2MethodSecurityConfiguration.class, OAuth2ResourceServerConfiguration.class,
|
||||
OAuth2RestOperationsConfiguration.class })
|
||||
|
||||
@@ -114,7 +114,7 @@ import org.springframework.web.servlet.config.annotation.ResourceChainRegistrati
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver;
|
||||
import org.springframework.web.servlet.handler.AbstractUrlHandlerMapping;
|
||||
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
|
||||
@@ -146,7 +146,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
@Configuration
|
||||
@ConditionalOnWebApplication(type = Type.SERVLET)
|
||||
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class,
|
||||
WebMvcConfigurerAdapter.class })
|
||||
WebMvcConfigurer.class })
|
||||
@ConditionalOnMissingBean(WebMvcConfigurationSupport.class)
|
||||
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE + 10)
|
||||
@AutoConfigureAfter({ DispatcherServletAutoConfiguration.class,
|
||||
@@ -170,15 +170,15 @@ public class WebMvcAutoConfiguration {
|
||||
return new OrderedHttpPutFormContentFilter();
|
||||
}
|
||||
|
||||
// Defined as a nested config to ensure WebMvcConfigurerAdapter is not read when not
|
||||
// Defined as a nested config to ensure WebMvcConfigurer is not read when not
|
||||
// on the classpath
|
||||
@Configuration
|
||||
@Import({ EnableWebMvcConfiguration.class, MvcValidatorRegistrar.class })
|
||||
@EnableConfigurationProperties({ WebMvcProperties.class, ResourceProperties.class })
|
||||
public static class WebMvcAutoConfigurationAdapter extends WebMvcConfigurerAdapter {
|
||||
public static class WebMvcAutoConfigurationAdapter implements WebMvcConfigurer {
|
||||
|
||||
private static final Log logger = LogFactory
|
||||
.getLog(WebMvcConfigurerAdapter.class);
|
||||
.getLog(WebMvcConfigurer.class);
|
||||
|
||||
private final ResourceProperties resourceProperties;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ import org.springframework.web.servlet.LocaleResolver;
|
||||
import org.springframework.web.servlet.View;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.handler.HandlerExceptionResolverComposite;
|
||||
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
|
||||
import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver;
|
||||
@@ -834,7 +834,7 @@ public class WebMvcAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class WebJars extends WebMvcConfigurerAdapter {
|
||||
protected static class WebJars implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
@@ -845,7 +845,7 @@ public class WebMvcAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class AllResources extends WebMvcConfigurerAdapter {
|
||||
protected static class AllResources implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
@@ -976,7 +976,7 @@ public class WebMvcAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class ValidatorWebMvcConfigurer extends WebMvcConfigurerAdapter {
|
||||
protected static class ValidatorWebMvcConfigurer implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public Validator getValidator() {
|
||||
|
||||
Reference in New Issue
Block a user