I am using Spring MVC 3.0.
I have to load the images which exist in the folder "images" parallel to the WEB-INFdirectory.
I have the jsp files in WEB-INF/jsp folder.
The folder structure is:
-app --images --WEB-INF ---jsp ---classes ... In web.xml the url mapping for DispatcherServlet is some thing like
<servlet-mapping> <servlet-name>test</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> Now in JSP if I load the jsp in the following way:
<img src="<%=request.getContextPath()%>/images/calogo.jpg" /> Its now working as DispatcherServlet is intercepting it I guess.