users@jersey.java.net

Re: [Jersey] Passing complex model objects to viewables

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Wed, 13 Oct 2010 13:03:53 +0200

On Sep 27, 2010, at 3:05 PM, ManiKanta G wrote:

>
> Hi,
>
> Is there any documentation describing this 'it' variable? I tried,
> but couldn't find.
>

Not yet, we need to write it.

You can find some external use here:

   http://scalate.fusesource.org/documentation/jog.html

and a simple sample here:

   http://download.java.net/maven/2/com/sun/jersey/samples/bookstore/1.4/bookstore-1.4-project.zip

> ManiKanta G
> twitter.com/ManiKantaG
>
>
> On Mon, Sep 27, 2010 at 3:52 PM, Martin Matula <martin.matula_at_oracle.com
> > wrote:
> Hi Timothy,
> Try this in the JSP:
>
> <%
> MyComplexType it = (MyComplexType) request.getAttribute("it");
> %>
>

If one accesses via the ${it} expression then "it" is treated as a
java bean so ${it.value} would need to have a correspond getValue in
the class of the instance referenced by "it".

Paul.

> Regards,
> Martin
>
>
> On Sep 23, 2010, at 10:52 PM, Timothy Rodriguez wrote:
>
> Hi guys,
>
> Forgive me if this is a simple question. But in the spirit of mvc I'm
> trying to use jersey to do a db query using jpa and pass the result
> list to a jsp for rendering. I see that viewable makes this object
> available as the parameter it. But I can't for the life of my figure
> out how to pass anything other than a string to the jsp.
>
> I want to pass a complex object. Cast it to the appropriate type in
> the jsp and then use it to render the page.
>
> Any thoughts? Am I going about this the wrong way?
>
> Thanks,
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>