I have code as follows:
<td width="24px">
<img src="${pageContext.request.contextPath}/images/success.gif"/>
</td>
My gif file is located at location
\src\main\webapp\images
It doesn't load the images when I try to load it by using Spring MVC framework.
I tried by giving the path
<img src="images/success.gif/">
<img src="webapp/images/success.gif/">
View Source gives:
<img src="/MyProject-UX/images/success.gif">
My spring config file:
<context:component-scan base-package="com.mycompany"/>
<mvc:annotation-driven />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/"/>
<property name="suffix" value=".jsp"/>
</bean>
@Controller
@RequestMapping("/closeWindow")
public class ClosingWindow {
@RequestMapping(method = RequestMethod.GET)
public String printHello(ModelMap model) {
return "closeWindow";
}