Re: Major session problem [GAE]

2011-06-09 Thread i...@e-dog.hu
On 2011.06.09. 10:48, Zeldor wrote: public static User loggedInUser; Is it correct? I think it is better without static! GeZo - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail:

Re: Major session problem [GAE]

2011-06-09 Thread Pepijn de Geus
Storing the User in a static field doesn't seem wise: the static field is shared between all session instances, so this will break. Besides that, I'd advise not to store the User instance itself in the session, but only the user ID (or username, or email). The User instance can be cached in a

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
Yeah, no idea why Static is there, must be some leftover from early code. It's good to have someone else take a look at your code and point the obvious :) I will check if it solves my problems. -- View this message in context:

RE: Major session problem [GAE]

2011-06-09 Thread Hielke Hoeve
class. final static Logger log; final static String applicationName = Zeldors application; final static String maxNumUsers = 2; Hielke -Original Message- From: Zeldor [mailto:pgronkiew...@gmail.com] Sent: donderdag 9 juni 2011 11:32 To: users@wicket.apache.org Subject: Re: Major session

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
norckon: Getting whole entity is good in my case. User can modify only his data and no one else can even access or see it. It speeds up things too. Anyway, how do you invoke the rest? Without static you of course get non-static method cannot be referenced from a static context compilation

Re: Major session problem [GAE]

2011-06-09 Thread Pepijn de Geus
The Wicket websession has a static .get(), which will always return the ThreadLocal session instance for the current user. So you can use that and cast the result to your session, or add your own get() to your session: public static MySession get() { return (MySession) WebSession.get();

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
So... MySession.get().getUser().getLand() to properly get a value from session? Looks like it could have some performance issues, or does it just look so scary? :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Major-session-problem-GAE-tp3584894p3585657.html