0

I have 100 BufferedImage object's in ArrayList, i want to show all of these images in a jsp.

<%
  ArrayList<BufferedImage> list = GlobalData.getImageBufferArrayList();
%>

 </head>
 <body>
 <ul>
 <li><img alt="" src=""> </li>//image1
 <li><img alt="" src=""> </li>//image2
 <li><img alt="" src=""> </li>//image3
   ...
   ..
   ...
 </ul>
</body>

I don't know what to put in src on these images

Is it possible to put image data as src of image.(Just like we get image data from canvas in html)

Or is their any decent way of showing these images.

JAVAGeek
  • 2,674
  • 8
  • 32
  • 52
  • you can save the images names/paths on string array and then in a "for" loop just write
  • – Elior Mar 19 '13 at 21:18
  • i don't have images on disk – JAVAGeek Mar 19 '13 at 21:21
  • 1
    you need a separate servlet that has a header content type image/png or jpg or gif. this servlet gets a buffered image and outputs it. in each src attributes let src='servlet?img=NUMBER' where NUMBER is the index of each image in the arraylist. – user1406062 Mar 19 '13 at 21:21
  • take a look at this answer http://stackoverflow.com/questions/2438375/how-to-convert-bufferedimage-to-image-to-display-on-jsp – Elior Mar 19 '13 at 21:25