You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Add the following to your corresponding WebPage...

...

Link logoutLink = new Link("my-link-wicket-id") {

	public void onClick() {
		getSession().invalidate();
		getRequestCycle().setRedirect(true);
		setResponsePage(WhereEverYouWantToRedirect.class); [1]
	}
};

...

[1] it is important to use setResponsePage() variant that takes a page class and not a page instance because a page instance would be stored in session that is now marked for invalidation - thus resulting in a page expired error

  • No labels