Rectangle 27 1

java Annotation Configuration Replacement for mvc:resources Spring?

public void addResourceHandlers(final ResourceHandlerRegistry registry) {

@Menuka Explaination: Every request which begins with "/resources/**" path will be mapped to a files in a "/resources/" folder.

One way to do this is to have your configuration class extend WebMvcConfigurerAdapter, then override the following method as such:

This answer is totally correct. However, if you're having issues (like I was) after adding this, remember that you might still need a default servlet handler described here:

Upvoted for the answer. Better if you can add explanation. That would be nice for a beginner.