Hi wicketiers,

Again questions about PageExpired...

I throught a couple of times about PageExpiredException. IMO this is not
a User Exception, i can not tell the user to restart the application. So
what can i do on PageExpired (on sessiontimeout) ?

To my mind there are a lot of ways for handling PageExpiredException on
sessiontimeout:
    1) For authorized pages we can simply redirect to the login-page.

    2) on public pages we should never show an error page, after the
user has clicked some stateful-ajax link.

       2.1) we should minimal redirect the user to the last bookmarked
page, this is the page, the user found the ajax-link. But this is a problem:
          My idea was to store the last bookmark-request-URL to the
session, if the session was destroyed the last URL was stored to an
Hashmap in the application with the key 'sessionID'
          Yeah, this sessionID was timeout to we get a new Session after
timeout. We have to provide a cookie with the last sessionID or a UUID
or the URL itself.
          With this cookie a can redirect the ajax-reqest to the last
known page.

       2.2) Prevend the PageExpiredException by include a <meta refresh
... > HTML fragment on the page and set it to the sessiontimeout+1s, so
each open Browser request the new   Bookmarkable Page and the session
was newly created. The Ajax-call would be executed ever, but the state
is new after timeout.
             - Can an AJAX-Response change the URL of the page so that
the last change through ajax is also encoded in URL ? Brix does
something like this.

       2.3) Prevend the PageExpiredException  by include the
bookmarkablePage URL on each ajax-request. So on Ajax-Request the Page
would simply build again with new state and the AJAX-Call works. I read
this was very tricky and not planned yet.
 
What do you guess about that? do you know any other fallbacks on
Pageexpired which dont confuse the Enduser ?

By the Way is it a good idea to store the Pagehierarchie not in
HttpSession, but in a EHCache implementation? I would also use a cookie,
that dont expires with the session and i would use this Cookie to know
the old user. the EHCache is fast and in memory with good and proved
Stragegies (LRU,...) and writing back to persistent store and so on. So
a new session should not cause a PageExpiredException on AJAX-Request.
Also the memory outside the HttpSession can be much bigger and EHCache
or whatever Implementation can be distributed.

What is your best practice ?


Martin






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to