Hi,
On Wed, May 15, 2013 at 4:16 PM, Benedikt Schlegel <codecab.dri...@gmail.com > wrote: > Hey there, i'm currently trying to understand what is actually needed so > Wicket considers a page stateful. Could you provide me some basic > information on that? > A Page is stateless by default. It becomes stateful when: - you call page.setStatelessHint(false) - you add a Component which org.apache.wicket.Component#getStatelessHint() returns false - you add a Behavior which org.apache.wicket.Behavior#getStatelessHint() returns false > > Basically, I want the user to authorize for the application and if he's > not, he should be send back to the login page. In the case of session > timeout, I want to add an error message to the login page, explaining what > happened. > I'm not sure you are able to do this. How you can recognize a request to an expired session versus a completely new request to the app (i.e. there is no session yet) ? > > I thought of using a SimplePageAuthorizationStrategy for the authorization > part, and solve the session timeout topic by subclassing the LoginPage (as > SessionTimeoutReloginPage or something) and register that as the > PageExpiredErrorPage. > PageExpierdErrorPage doesn't mean necessary that the session has expired. PageExpiredException is thrown when a page instance cannot be found in the page store. Reasons could be: - the page is not stored at all (e.g. problems during serialization or simply there is was no store operation for page with id=XYZ) - the store has been overloaded and the oldest page has been removed from it - the session has expired and all pages in the store (i.e. the history stack) has been removed > But somehow, I can't get that error page to show up. > The SimplePageAuthorizationStrategy always sends me straight back to the > LoginPage after session timeout. > -- Martin Grigorov Wicket Training & Consulting http://jWeekend.com <http://jweekend.com/>