-
1. Re: Session Expired Handling with Ajax4jsf
robjellinghaus Mar 13, 2007 1:20 PM (in response to kfletcher2005)You will get better response posting this in the users forum. This forum is more for discussion of code changes to Ajax4jsf itself.
-
2. Re: Session Expired Handling with Ajax4jsf
sergeysmirnov Mar 13, 2007 1:32 PM (in response to kfletcher2005)You misunderstood the idea what it is for.
A4J.AJAX.onExpired is fired when the browser sends the Ajax Request after the session is expired.
It is not about popping up something on the client without any prior communication with server. -
3. Re: Session Expired Handling with Ajax4jsf
kfletcher2005 Mar 13, 2007 2:03 PM (in response to kfletcher2005)I don't understand you. I'm not trying to pop something up for production, just for a proof of concept to see if the thing works like I think. I would expect the browser to send a session expiration event to be fired, and the following script below to be invoked upon that event.
A4J.AJAX.onExpired = function(loc,expiredMsg){
//custom code here.... but for now, see if the thing works by putting in an //alert....
alert("Hey dude, the session expired");
};
------
Given the code, wouldn't one expect a popup with said string (just as a sanity check). I'll post this question to user forum. -
4. Re: Session Expired Handling with Ajax4jsf
sergeysmirnov Mar 13, 2007 5:51 PM (in response to kfletcher2005)browser cannot send a session expiration event as far as session is expiring on the server, but on the client side.
The use case:
A Bank officer launches the application and goes to the page with customer list
Then he decides to have a lunch
Then he decided to speak with coworker about something
Then he decided to watch couple moves on youtube.com
Finally, he returns back to the office and clicks the button on one of the record in the customer list for details.
It was an Ajax button, actually. The Ajax request is sent to the server. As soon as the 1-minute session timeout developer set up for this application is already expired, the server sends the special Ajax response that contains the expiration event.
The client code invokes A4J.AJAX.onExpired method. -
5. Re: Session Expired Handling with Ajax4jsf
kfletcher2005 Mar 13, 2007 6:10 PM (in response to kfletcher2005)LOL! Nice use case. Thanks for the clarification. So the magic trick is the user has to click an AJAX'd button (or command link), then we make a round trip to server, then server says hey wait a minute, your session is no good, then sends ajax response with expiration event info. Thanks.
-
6. Re: Session Expired Handling with Ajax4jsf
sergeysmirnov Mar 13, 2007 6:38 PM (in response to kfletcher2005)Yep. Now, we are on the same page.