webtier@glassfish.java.net

Re: [webtier] Blob image and JSF 2

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Date: Thu, 7 Jan 2010 11:42:53 -0500

You can simply access the HttpServletResponse OutputStream directly from a
faces-javaBean method, called when a specific JSF viewId (the URL of the
image) is accessed... from there you can call
facesContext.responseComplete() after the image has been streamed. That's a
way around using a custom servlet, and still gaining access to the faces
lifecycle (should you choose.) though it will likely be less efficient than
a thin servlet-based implementation.

--Lincoln

On Thu, Jan 7, 2010 at 11:34 AM, Jim Driscoll <Jim.Driscoll_at_sun.com> wrote:

> That's often the way such things are handled. Without knowing other
> details, I can't say if that's the best way... but it probably is.
>
> Jim
>
>
> On 1/7/10 7:51 AM, Celinio Fernandes wrote:
>
>> well,
>> i managed to handle it with a servlet and the <h:graphicImage> tag.
>> Someone knows better ?
>>
>>
>> --- On *Thu, 1/7/10, Celinio Fernandes /<papouasied_at_yahoo.com>/* wrote:
>>
>>
>> From: Celinio Fernandes <papouasied_at_yahoo.com>
>> Subject: [webtier] Blob image and JSF 2
>> To: webtier_at_glassfish.dev.java.net
>> Date: Thursday, January 7, 2010, 8:09 PM
>>
>> Hi,
>> I have an image which is stored in a database. It is mapped to a
>> Blob variable in an entity bean.
>> Before digging further into the documentation, I thought I'd ask here :
>> is there a standard or a recommended way to handle a Blob image in
>> JSF 2 ?
>>
>> Thanks.
>>
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>


-- 
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"