You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pazhanikanthan Periasamy <Pa...@caritor.com> on 2005/12/20 06:28:17 UTC

Re: how to show an image without its address or OutputStream ?

You can do this:

<img src="ImageDispalyServlet?imagename=uniqueidentifier"> 

You need to write a Servlet or Action call which will identify the Image 
uniquely and then get the Image from anywhere (Local harddisk or DB, etc) 
and then flush the content with IMAGE MIME.

Hope this helps.

Thanks and regards,
Pazhanikanthan. P
Project Leader,
Caritor (India) Pvt. Ltd.,
Madras - 600 006




Reza Ghaffaripour <re...@gmail.com> 
12/20/2005 11:04 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
user@struts.apache.org
cc

Subject
how to show an image without its address or OutputStream ?






Hi
i want to show an image in my jsp page. i DON'T want to user the image's
address (on the server's hard disk) and i want to get it directly from db
and set it to the form or something....

i also don't want to user ServletOutputStream outStream =
response.getOutputStream(); because it opens the image in a new page or it
wants to download it.

is there a way to send the image directly to src attribute of the img tag 
?



--
Reza Ghaffaripour
www.rezaghp.com