Im trying to develop a gallery application where i have to access all the images in Web Content folder and display them as thumbnails on a jsp page. After displaying them on jsp page, when i click on any image it should be opened in a pop up window.
Can i develop this application just using a jsp or should i make use of servlet for rendering the images. Need the exact approach to develop this one.
I have been trying to find out ways to do this but couldn't get proper references. Can someone please tell me the ways to develop this and provide me with references that are close to my need. Appreciate your help.
This is what i have tried:
List imageUrlList = new ArrayList();
File imageDir = new File("/myapp/images");
for(File imageFile : imageDir.listFiles()){
String imageFileName = imageFile.getName();
// add this images name to the list we are building up
imageUrlList.add(imageFileName);
}
request.setAttribute("imageUrlList", imageUrlList);
<c:forEach var="img" items="${imageUrlList}">
<img >
</c:forEach>
Aucun commentaire:
Enregistrer un commentaire