I'm not sure what all you're trying to make easier, but as far as displaying
the user - you could use this:
new Label("username", new PropertyModel(this, "session.user.username"));
--
Jeremy Thomerson
http://www.wickettraining.com
On Mon, Jul 28, 2008 at 2:34 PM, insom <[EMAIL PROTECTED]> wrote:
>
> I'm trying to display a user's name in the browser. I'm using SWARM for
> authentication. My general idea is that the user signs in with this
> function:
>
> public boolean signIn(String username, String password) {
> LoginContext ctx = new FoodHandlerContext(username, password);
> MySession session = (MySession)getSession();
> session.login(ctx);
> session.setUser(session.getFoodHandlerDAO().getUserByUsername(username));
> }
>
> Then, when I need any information about the user, I get it in the following
> way:
>
> add(new Label(((MySession)getSession()).getUser().getUsername()));
>
> This works, but my sense of Wicket is that there's probably a better "best
> practice" for maintaining session objects like the User. My question is,
> can
> I leverage Wicket's structure to make session object management easier than
> I'm doing?
> --
> View this message in context:
> http://www.nabble.com/Getting-User-from-Session-tp18697696p18697696.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>