When i have my JavaConfig class extends WebMvcConfigurerAdapter like this:
@EnableWebMvc
@EnableSpringDataWebSupport
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(new CustomPageableArgumentResolver());
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/login").setViewName("login");
}
}
my custom Resolver and viewControllers are registered and added when the application deployed.
But when i want to change the super class to WebMvcConfigurationSupport, which also has those methods (add*) and of course more to offer, the Resolver and ViewControllers are not registered. Why?
I have just found the answer. While using the WebMvcConfigurationSupport, we need to remove the annotation @EnableWebMvc