I am developing a shopping cart in Sprng MVC from where seller can upload products image with its description. I am able to upload images to webapp/resources/images
folder. now I have to load all these images to dashboard page (home page) when any user open my site. I am not able to load these images from this location.
In my jsp I am writing final code like this:
<img src="resources/images/product1.jpg"/>
how can I add this folder to classpath so it'll be available. I am using Spring MVC and MAVEN.
Please let me know how to achieve this.
I am able to fix this problem: Added the following resources declaration to Spring configuration
<resources mapping="/resources/**" location="/resources/" />
and in jsp
<img src="<c:url value="/resources/images/product1.jpg" />" alt="" />
Thanks guys for your all help, your direction really helped me to get the answer for this problem.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments