You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by mxc <ma...@jumpingbean.co.za> on 2007/03/28 18:09:48 UTC

How to persist a variable to the user session programatically?

Hi there,

Is there a way to do @Persist programatically?

i.e this.addToSession("var");

Also is there a way to go this.getFromSession("var")
thanks
-- 
View this message in context: http://www.nabble.com/How-to-persist-a-variable-to-the-user-session-programatically--tf3481329.html#a9717068
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: How to persist a variable to the user session programatically?

Posted by Martino Piccinato <ma...@gmail.com>.
You can also get the WebSession object thourgh teh IRequestCycle

On 3/28/07, Martino Piccinato <ma...@gmail.com> wrote:
>
> Just look at this page:
>
> http://tapestry.apache.org/tapestry4.1/usersguide/state.html
>
> you are probably looking for Application State Object (ASO).
>
> it's just what you want to do but hiding the retrieve/store complexities
> that will be handled automatically by tapestry.
> You just decide what's your ASO, declare it as an ASO, inject in the pages
> you want to use it and forget about session details.
>
> Hope it was of some help.
>
> On 3/28/07, mxc < mark@jumpingbean.co.za> wrote:
> >
> >
> > Hi there,
> >
> > Is there a way to do @Persist programatically?
> >
> > i.e this.addToSession("var");
> >
> > Also is there a way to go this.getFromSession("var")
> > thanks
> > --
> > View this message in context: http://www.nabble.com/How-to-persist-a-variable-to-the-user-session-programatically--tf3481329.html#a9717068
> >
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: How to persist a variable to the user session programatically?

Posted by Martino Piccinato <ma...@gmail.com>.
Just look at this page:

http://tapestry.apache.org/tapestry4.1/usersguide/state.html

you are probably looking for Application State Object (ASO).

it's just what you want to do but hiding the retrieve/store complexities
that will be handled automatically by tapestry.
You just decide what's your ASO, declare it as an ASO, inject in the pages
you want to use it and forget about session details.

Hope it was of some help.

On 3/28/07, mxc <ma...@jumpingbean.co.za> wrote:
>
>
> Hi there,
>
> Is there a way to do @Persist programatically?
>
> i.e this.addToSession("var");
>
> Also is there a way to go this.getFromSession("var")
> thanks
> --
> View this message in context:
> http://www.nabble.com/How-to-persist-a-variable-to-the-user-session-programatically--tf3481329.html#a9717068
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: How to persist a variable to the user session programatically?

Posted by Robert Zeigler <ro...@scazdl.org>.
You can inject the session service into your page/component...

@Inject("alias:Session")
org.apache.tapestry.services.Session session;

You can then call session.getAttribute("var")

Robert

On Mar 28, 2007, at 3/2811:09 AM , mxc wrote:

>
> Hi there,
>
> Is there a way to do @Persist programatically?
>
> i.e this.addToSession("var");
>
> Also is there a way to go this.getFromSession("var")
> thanks
> --  
> View this message in context: http://www.nabble.com/How-to-persist- 
> a-variable-to-the-user-session-programatically-- 
> tf3481329.html#a9717068
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org