I read in a blog post titled SPRING 3.1 M2: SPRING MVC ENHANCEMENTS that it was possible to replace the <resources mapping="/resources/**" location="/resources/" /> element with the following equivalent:
@Configuration
@EnableWebMvc
public class AppConfiguration extends WebMvcConfigurerAdapter {
@Override
public void configureResourceHandling(ResourceConfigurer configurer) {
configurer.addPathMapping("/resources/**").addResourceLocation("/resources/");
}
}
However in Spring 3.2.0.RELEASE I don’t seem to be able to find ResourceConfigurer. Did this functionality make it to an official release ever? It’s possible I have something wrong with my dependencies but before I post all of that I just wanted to check.
This mechanism was re-worked for 3.2, I had the same problem a couple of months ago. Now what you have to do is override a different method. The following seemed to work for me, although you may need to play with the paths etc: