It would be useful to add a reference to the section on "Advanced Customizations with MVC Java Config" since the above is not possible to do with the @EnableWebMvc/WebMvcConfigurer combo which is the starting point for using the MVC java config.