I am relatively new to Java EE Spring Framework. I am running a spring mvc spring maven project in Netbeans and I have the following structure for the "Web Pages" directory in the project files:
-Web Pages
--WEB-INF
---views
----welcome.jsp
-resources
--DPI.PNG
and this is the configuration class:
public class HelloWorldConfiguration {
@Bean(name = "HelloWorld")
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/views/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// Css resource.
registry.addResourceHandler("/resources/**") //
.addResourceLocations("/resources/");
}
}
and in the welcome.jsp I access the image using the following html:
<img src='/resources/DPI.PNG'>
and when I access the page it gives 404 not found for the image,
What is the problem??