Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
...

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

	public void onClick() {
		// you can use "getSession().invalidateNowinvalidate();" if you want to remove all wicket components from the session
		getSessiongetRequestCycle().invalidatesetRedirect(true);
		getRequestCyclesetResponsePage()WhereEverYouWantToRedirect.setRedirect(trueclass);
		/* [1]
	}
};

...

Wiki Markup
\[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

...