I used WebMvcConfigurerAdapter for a while. Since I could not get all the registered interceptors using the getInterceptors () method, I switched to WebMvcConfigurationSupport, which has many default Spring Beans registered, such as ContentNegotiationManager, ExceptionHandlerExceptionResolver usw.
Now I realized that a very handy DomainClassConverter (which converts domain class identifiers to domain class objects using CrudRepository) is not registered by default, although I use the @EnableSpringDataWebSupport annotation in my WebConfig class.
When I define this bean explicitly like this, it works then.
@EnableSpringDataWebSupport
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
@Bean
public DomainClassConverter<?> domainClassConverter() {
return new DomainClassConverter<FormattingConversionService>(mvcConversionService());
}
}
EnableSpringDataWebSupport WebMvcConfigurationSupport?