I am trying to display an image in a jsp page which is stored as a blob in the oracle table.
I wrote a stored procedure to get all the images for a particular id.
and in the servlet(action), I wrote the following:
code:
ResultSet rsImg = verServ.getImages(EtaId,conn);
while(rsImg.next())
{
VDTO vadto = new VDTO();
Blob Imgs = rsImg.getBlob("IMG");
byte ImgData[] = Imgs.getBytes(1,(int)Imgs.length());
vadto.setImgData(ImgData);
vadto.setImgs(rsImg.getBlob("IMG"));
ImagesLst.add(vadto);
}
request.setAttribute("images", ImagesLst);
I am passing the Arraylist as a request Attribute to the jsp page, from where the Img tag calls a servlet passing the byte[].
Although I use Struts Framework, I would use jsp/struts tags for displaying my image(s) in jsp
Please guide me to write tags in jsp/struts for displaying my images.