aspose file tools*
The moose likes Struts and the fly likes how to display dynamic image in jsp along with other content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to display dynamic image in jsp along with other content " Watch "how to display dynamic image in jsp along with other content " New topic
Author

how to display dynamic image in jsp along with other content

G.T. Reddy
Ranch Hand

Joined: Jun 25, 2002
Posts: 45
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.

Regards,
GTR
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to display dynamic image in jsp along with other content