Using WebMvcConfigurerAdapter

@Configuration
@EnableWebMvc
public class MetricsWebMvcConfiguration extends WebMvcConfigurerAdapter {
:
: your code here
:
}

Using WebMvcConfigurationSupport

@Configuration
public class WebMvcConfiguration extends WebMvcConfigurationSupport {
:
: your code here
:

}

Do’s and Don’ts

  • Use only one method for the MVC configuration
  • When using WebMvcConfigurerAdapter, use only one subclass otherwise all but one subclass will be ignored.
Advertisements