_ApplicationContext.xml:_
<mvc:resources mapping="/images/**"
location="file:${catalina.home}/props/" cache-period="1234" />
<mvc:annotation-driven />
_VideosModule.java:_
public static void contributeIgnoredPathsFilter(Configuration<String>
configuration) {
configuration.add("/images/.*");
}
_Index.tml:_
<img src="${contextPath}/images/home.jpg" width="130" />
_Index.java:_
@Inject
private HttpServletRequest servletRequest;
public String getContextPath() {
return servletRequest.getContextPath();
}
When I run the application it runs successfully, however images not loaded
*_Using inspect element get the tag:_*
<imgwidth="130"src="/Videos/images/home.jpg"> ---> It shows *Failed to
load the given URL*
Any idea?
On 5/17/2013 12:04 PM, Lance Java wrote:
Does your webapp have a context path? You may need to use
<img src="/contextPath/images/..."
You can use request.getContextPath() to make it dynamic