Hi,

Save the logged in user id in the Session.

MySession.java:

private long userId;

public User getUser() {
  return userService.getUserById(userId);
}


AnyPage.java:
user = MySession.get().getUser();

On Fri, Mar 2, 2012 at 9:38 PM, Paolo <[email protected]> wrote:
> I use this code as base:
>
> http://wicketstuff.org/wicket14/authentication/
>
> I added registration and user/password sign-in and checking with database, 
> instead of simple "wicket" as user and password.
> All works ok, but now I need in AdminPage to known which user is logged in.
>
> How can I implement it?
> Is there some Wicket implementation?
> Do I need to store user in Session or with cookies or in PageParameters? Is 
> it secure?
>
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to