Reputation: 1189
I am trying to use resources using Spring MVC. I have a class WebApplicationContextConfig that extends WebMvcConfigurerAdapter and in there I am overriding method addResourceHandlers:
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/img/**")
.addResourceLocations("/resources/");
}
In folder resources I have three images. But when I go in browser to get some image, for ex: http://localhost:8080/img/P123.jpeg I got 404 error.
Am I missing something?
Upvotes: 0
Views: 398
Reputation: 506
Upvotes: 1