You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Saeed Najahi <na...@gmail.com> on 2011/05/16 17:47:57 UTC

Displaying images from database (BLOB) using the tag

hello guys, can anyone kindly tell me how can i display an image fetched
from a database using the <img> tag? thanks in advance.

-- 
--------------------------------------------------------------------------------------------------------
`*The early bird catches the worm, but the second mouse gets the cheese..*`

*NAJAHI Saïd* (* KyouJin-SaMa* )
4ème année G.Info E.N.S.A.Safi
-----------------------------------------------------------------------------

Re: Displaying images from database (BLOB) using the tag

Posted by Chris Pratt <th...@gmail.com>.
Stream it to the ServletOutputStream and return null from the action.
  (*Chris*)
On May 16, 2011 8:48 AM, "Saeed Najahi" <na...@gmail.com> wrote:
> hello guys, can anyone kindly tell me how can i display an image fetched
> from a database using the <img> tag? thanks in advance.
>
> --
>
--------------------------------------------------------------------------------------------------------
> `*The early bird catches the worm, but the second mouse gets the
cheese..*`
>
> *NAJAHI Saïd* (* KyouJin-SaMa* )
> 4ème année G.Info E.N.S.A.Safi
>
-----------------------------------------------------------------------------

Re: Displaying images from database (BLOB) using the tag

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Take a look at http://struts.apache.org/2.x/docs/stream-result.html

On 16 May 2011 18:41, Ilya Kazakevich <Il...@jetbrains.com> wrote:
> You need action (or servlet) that will read image from db and write image to
> the output stream setting appropriate conent-type.
> Than you do: <img src="my.action"/>
>
>
>
>
>
> Ilya Kazakevich,
> Developer
> JetBrains Inc
> http://www.jetbrains.com
> "Develop with pleasure!"
>
> -----Original Message-----
> From: Saeed Najahi [mailto:najahi88@gmail.com]
> Sent: Monday, May 16, 2011 7:48 PM
> To: user@struts.apache.org
> Subject: Displaying images from database (BLOB) using the <img> tag
>
> hello guys, can anyone kindly tell me how can i display an image fetched
> from a database using the <img> tag? thanks in advance.
>
> --
> ----------------------------------------------------------------------------
> ----------------------------
> `*The early bird catches the worm, but the second mouse gets the cheese..*`
>
> *NAJAHI Saïd* (* KyouJin-SaMa* )
> 4ème année G.Info E.N.S.A.Safi
> ----------------------------------------------------------------------------
> -
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Displaying images from database (BLOB) using the tag

Posted by Ilya Kazakevich <Il...@JetBrains.com>.
You need action (or servlet) that will read image from db and write image to
the output stream setting appropriate conent-type.
Than you do: <img src="my.action"/>


 


Ilya Kazakevich,
Developer
JetBrains Inc
http://www.jetbrains.com
"Develop with pleasure!"

-----Original Message-----
From: Saeed Najahi [mailto:najahi88@gmail.com] 
Sent: Monday, May 16, 2011 7:48 PM
To: user@struts.apache.org
Subject: Displaying images from database (BLOB) using the <img> tag

hello guys, can anyone kindly tell me how can i display an image fetched
from a database using the <img> tag? thanks in advance.

-- 
----------------------------------------------------------------------------
----------------------------
`*The early bird catches the worm, but the second mouse gets the cheese..*`

*NAJAHI Saïd* (* KyouJin-SaMa* )
4ème année G.Info E.N.S.A.Safi
----------------------------------------------------------------------------
-


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org