I have Java web app with following structure
WebContent->images->image.jpg
->js->test.js
I tried displaying an image in my jsp with the following code.
<img src="${pageContext.request.contextPath}/images/image.jpg" width="500" height="500" />
Firebug shows a GET request with the below URL
http://localhost:8080/test/images/image.jpg
With a 200 ok response, but displays nothing.
I checked these questions:
Unable to load static contents (Images/JS) in web-application
But didn't help. Is there anything wrong with what I am doing?
My servlet mapping
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>com.test.HomeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>