On 7/31/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> i wouldnt recommend doint this in session because user entity will become
> detached, i would instead do it in the requestcycle so the user is loaded
> once per request
It is? I've used a User-object in session and I haven't noticed that
it gets detached.... I guess I'll have to look into to that.
Can I still have a getUser() method in Session that in turn uses the code below?
I think I saw an example (could have been in databinder) where a
IModel was stored in session. Is that an alternative?
> ((MyRequestCycle)RequestCycle.get()).getUser();
>
> MyRequestCycle {
> private transient User user;
>
> getuser() { if (user==null) { user=loaduser(session.get().getuserid()); }
> onendrequest() { user=null; }
> }
>
> -Igor
>
/Mats
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user