webtier@glassfish.java.net

Re: [webtier] Load a view file from the classpath?

From: Jason Lee <jasondlee_at_sun.com>
Date: Thu, 05 Nov 2009 16:55:00 -0600

On Nov 5, 2009, at 4:44 PM, Lincoln Baxter, III wrote:

> I think that should be possible... how would you recommend I point
> VDLFactory at the file on the classpath. Is there a way to get it to
> accept a URL, or a resource?
>
>
> Util.notNull("context", context);
> String actualViewId = derivePhysicalViewId(context, viewId,
> false);
> return
> vdlFactory
> .getViewDeclarationLanguage(actualViewId).createView(context,
> actualViewId
> );
>
> Or do I even need to do this as long as all of the Handlers know to
> translate the custom ViewId into something real?
>
> I guess I'm a little lost since it looks like everything I would do
> to "Build a UIViewRoot" requires a String viewId... which I'm not
> sure would let me do what I need to with the classpath.


That's a good question. I've considered the issue you're trying to
solve in passing over the past couple of weeks, but haven't gone much
deeper than the ViewHandler (too many other irons in the fire). I'll
see if I can give that some more active thought. Which doesn't help
you now, but we'll see what I can find on my end. :)

         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