Using the WebMvcConfigurerAdapter.