Doesn't work for me...

I have a PageLink class with a onClick() method that looks like this:

public void onClick() {
        super.onClick();
        this.setRedirect(true);
        this.getSession().invalidate();
}

super.onClick(); sets the response page.


I do not end up with the desired login page, but get "Page Expired".

/Anders


Martijn Dashorst wrote:
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]






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

Reply via email to