Since you need to do some actions on session expiration, have you considered to use method onInvalidate() of Session?
Hi all,

Please consider the following scenario:

The user clicks a logout link after the session is expired. The link
needs to execute behaviour on the server while the page it is on has
no relevance - it may not even be rendered. While the page has
expired, the user has a fresh authenticated session thanks to
remember-me cookie. This situation is frustrating because the user
will NOT understand that anything can expire with a remember-me
cookie. The logout action is required to destroy the remember-me
cookie.

We require that the behaviour of a logout be invoked under all
conditions even if the page is stateful e.g. if there are AJAX
components on the page.

We are in a better position now after the fix of

Mounted bookmarkable Page not recreated on Session Expiry
https://issues.apache.org/jira/browse/WICKET-4997

However while the page is found after expiry, the link behaviour is
not executed.

Wicket does not do this in order to prevent unexpected results in case
of invalid component state. See

Do not use the parsed PageParameters when re-creating an expired page
https://issues.apache.org/jira/browse/WICKET-4594

and

Page#isPageStateless() may return wrong value
https://issues.apache.org/jira/browse/WICKET-5083

Because of the policies behind these issues, on application level it
appears futile trying to apply tricks like adding stateful components
in onBeforeRender().

This would allow  ListenerInterfaceRequestHandler#respond() to
consider a page stateless in the early construction phase. I have been
able to use this technique, but it is against these policies, ugly,
and I have some doubts whether it still works.


So how can this requirement be met? I can imagine that Wicket could
let each component override Wicket's behaviour blocking, but there
might be better solutions.

Regards,

Bernard


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


Reply via email to