how to display dynamic image in jsp along with other content
Joined: Jun 25, 2002
Hi, I am facing the one problem while displaying dynamic image along with other content. I am able to create the image from the blob but I don�t know where to keep this image in the server or else where so that I can give the link in JSP to this image path. In the jsp page along with this image I need to display some report. If image is the only one to display I can do it. But I am not able to display along with some other content. Please help If some body knows the solution.
Joined: Feb 15, 2005
One way to do it would be to create an action such as "image". Then, in your Image action class, get the BLOB, convert it to stream of data, and send it to the output stream of the HTTPServletResponse object.
Then in your jsp, you can code <img scr="image.do?imageName=image1">
There's an example of this in the struts-examples.war that comes with the Struts download. Check out the class: org.apache.struts.webapp.exercies.ImageAction [ January 12, 2006: Message edited by: Merrill Higginson ]