webtier@glassfish.java.net

Re: [webtier] Blob image and JSF 2

From: Jason Lee <jasondlee_at_sun.com>
Date: Mon, 11 Jan 2010 08:58:00 -0600

FWIW, Mojarra Scales has a component that will take care of that for you:

http://kenai.com/projects/scales/pages/Download

Version 1.3.x is 1.2-based, but should work in a 2.0 environment. If
you'd prefer a 2.0 version, you can use the SNAPSHOT in the java.net
Maven repo. While some components, most notably sc:dataTable are a bit
broken at the moment, most, including sc:download, should be very stable
in the SNAPSHOT.

On 1/7/10 10:42 AM, Lincoln Baxter, III wrote:
> 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
> <mailto: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
> <mailto:papouasied_at_yahoo.com>>/* wrote:
>
>
> From: Celinio Fernandes <papouasied_at_yahoo.com
> <mailto:papouasied_at_yahoo.com>>
> Subject: [webtier] Blob image and JSF 2
> To: webtier_at_glassfish.dev.java.net
> <mailto: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
> <mailto:webtier-unsubscribe_at_glassfish.dev.java.net>
> For additional commands, e-mail:
> webtier-help_at_glassfish.dev.java.net
> <mailto:webtier-help_at_glassfish.dev.java.net>
>
>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.com
> http://scrumshark.com
> "Keep it Simple"


-- 
Jason Lee
Senior Java Developer
GlassFish Administration Console
Sun Microsystems, Inc.
Phone x31197/+1 405-343-1964
Email jasondlee_at_sun.com
Blog http://blogs.sun.com/jasondlee
Blog http://blogs.steeplesoft.com