• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

how to display dynamic image in jsp along with other content

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
"To do good, you actually have to do something." -- Yvon Chouinard
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic