简体   繁体   中英

showing image from resources folder with only using JSP

I have images of products. I wanted to render these images with html tag in jsp. I put images in src/main/resources directory in intellij idea. I am creating war file and deploying it on jboss server. I have tried a lot of paths to specify src attribute of img tag, but it can't find image. I have seen a solution where people create another servlet and pass it local path to the image to render, but I want to do it with just JSP. So the question is, where should I save images, or which path should I write in img src attribute to render the image, without creating additional servlet?

We're using JSTL tags in JSP to render the images from resources folder Import statement: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> Usage: <c:url value='/images/softy.jpg'/> For us Images are in Resources/images folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM