iirc:

setResponsePage(LoginPage.class);
setRedirect(true);
getSession().invalidate();

Martijn

On 1/13/08, Anders Peterson <[EMAIL PROTECTED]> wrote:
> I have a related question. What should I do when the user logs out.
> Currently I just set "username" to null and redirect to the original
> login page. I feel I also should invalidate the session but that doesn't
> work.  Then I always end up with a "Page Expired" page. I'd like to
> still end up with the login page.
>
> /Anders
>
> Martijn Dashorst wrote:
> > Have one session that knows when authentication has happened...
> >
> > public MySession extends WebSession {
> >     private String username;
> >
> >     public void setUsername(....){}
> >
> >     public boolean isAuthenticated() {
> >         return username != null;
> >     }
> > }
> >
> > Then in your web page you can do:
> >
> > if (!((MySession)getSession).isAuthenticated()) throw
> > restartrequestatinterceptpage(...);
> >
> > Martijn
> > On Jan 13, 2008 7:21 AM, xdirewolfx <[EMAIL PROTECTED]> wrote:
> >> Assume I have created 2 different sessions:
> >>  - standard session
> >>  - authenticated session
> >>
> >> I have a class MyWebPage with this method:
> >>  - MyWebPage(boolean isAuthenticated) : true = request authentication
> >>
> >> how do I do this programmatically?
> >> --
> >> View this message in context: 
> >> http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14782689.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]
> >>
> >>
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to