webtier@glassfish.java.net

Re: [webtier] JSF2: Exposing dynamic content as a Resource?

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Thu, 29 Apr 2010 17:45:01 -0500

On 4/29/10 5:41 PM, webtier_at_javadesktop.org wrote:
> Trying to determine how best to expose an image kept in a database as a resource via JSF2.
>
> Resources as specified look great for serving static content.
>
> Up front, it seems I may have to override the default ResourceHandler. But how best to do that portably and without stomping on primefaces/richfaces etc is not clear (these seem to provide their own resource handlers as well).
>
> Ideally, it would be nice to bind a class implementing 'ResourceBundle' as a library visible to the ResourceHandler, where Object's returned by the bundle would have a data stream, and a content type.
>
> Any thoughts on how best to do this?
>
Mojarra Scales has a component for that:

http://demo.steeplesoft.com/mojarra-scales-demo/download.jsf

Source is on kenai.com

-- 
Jason Lee
Senior Member of Technical Staff
GlassFish Administration Console
Oracle Corporation
Phone x31197/+1 405-343-1964
Blog http://blogs.steeplesoft.com