You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Sheldon Ross <ro...@hotmail.com> on 2009/02/03 23:57:32 UTC

Changing context(tool.session) object

I have used session tools before, but normally I can use the tool I put in session. 
In this case, I want to overwrite the tool, and keep it across the session, is there a way to do this?

ex: TurbineResources prop

tool.session.myObj = org.myapp.taglibs.Obj


Code:

Obj obj = (Obj)context.get("myObj");
obj = new Obj();

This doesn't seem to work because it doesn't actually change the session's reference? 
Or am I doing something wrong. Is there a better way to keep an object persistent in a session?

Thanks alot,

Sheldon Ross

_________________________________________________________________
Windows Live™ Hotmail®:…more than just e-mail. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_012009

RE: Changing context(tool.session) object

Posted by Sheldon Ross <ro...@hotmail.com>.
I tried that and it didn't seem to work. I ended up just putting the object in SessionData when the user logs in.

ie:
tool.session.sessionData=org.apache.turbine.services.pull.util.SessionData

It seems to work well and seems to just be an implementation of HashMap.

Thanks!

> Subject: RE: Changing context(tool.session) object
> Date: Wed, 4 Feb 2009 09:05:47 -0600
> From: TonyO@prepare-enrich.com
> To: user@turbine.apache.org
> 
> data.getSession().setAttribute("MYTAG", myObj);
> data.getSession().getAttribute("MYTAG");
> 
> 
> Tony 
> 
> -----Original Message-----
> From: Sheldon Ross [mailto:ross_sheldon@hotmail.com] 
> Sent: Tuesday, February 03, 2009 4:58 PM
> To: turbine-user@jakarta.apache.org
> Subject: Changing context(tool.session) object
> 
> 
> I have used session tools before, but normally I can use the tool I put
> in session. 
> In this case, I want to overwrite the tool, and keep it across the
> session, is there a way to do this?
> 
> ex: TurbineResources prop
> 
> tool.session.myObj = org.myapp.taglibs.Obj
> 
> 
> Code:
> 
> Obj obj = (Obj)context.get("myObj");
> obj = new Obj();
> 
> This doesn't seem to work because it doesn't actually change the
> session's reference? 
> Or am I doing something wrong. Is there a better way to keep an object
> persistent in a session?
> 
> Thanks alot,
> 
> Sheldon Ross
> 
> _________________________________________________________________
> Windows Live(tm) Hotmail(r):...more than just e-mail. 
> http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_exp
> lore_012009
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
> For additional commands, e-mail: user-help@turbine.apache.org
> 

_________________________________________________________________
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_022009

RE: Changing context(tool.session) object

Posted by Tony Oslund <To...@prepare-enrich.com>.
data.getSession().setAttribute("MYTAG", myObj);
data.getSession().getAttribute("MYTAG");


Tony 

-----Original Message-----
From: Sheldon Ross [mailto:ross_sheldon@hotmail.com] 
Sent: Tuesday, February 03, 2009 4:58 PM
To: turbine-user@jakarta.apache.org
Subject: Changing context(tool.session) object


I have used session tools before, but normally I can use the tool I put
in session. 
In this case, I want to overwrite the tool, and keep it across the
session, is there a way to do this?

ex: TurbineResources prop

tool.session.myObj = org.myapp.taglibs.Obj


Code:

Obj obj = (Obj)context.get("myObj");
obj = new Obj();

This doesn't seem to work because it doesn't actually change the
session's reference? 
Or am I doing something wrong. Is there a better way to keep an object
persistent in a session?

Thanks alot,

Sheldon Ross

_________________________________________________________________
Windows Live(tm) Hotmail(r):...more than just e-mail. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_exp
lore_012009

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
For additional commands, e-mail: user-help@turbine.apache.org