Hi Harmmeijer,
Thanks for your reply. The above solution will display the alert message after every 25 minutes. Even though the session is valid after 25 minutes (user opens a sub window which sends the request to the server), the alert msg will be displayed to the user.
My exact requirement is I need to display the popup msg before 5 minutes of the session expiry. I am having 3 frames (top, right, main) out of which the top frame is static throughout the application. I thought of implementing the session expiry logic in the top frame (top.jsp) since it is static and used throughout the application. Otherwise, I need to implement it in all the jsp files used in the application. I don't want to do that. I can get the last accessed session time using
<%=session.getLastAccessedTime()%>. This value is used in the top frame to calculate the idle time of the browser. The problem is since the top.jsp is static, I can get the session.getLastAccessedTime() when the frame is loaded initally. How can I get the session.getLastAccessedTime() from the jsp (say after every 25 minutes) without reloading the page.
I also thinking of implementing the session popup expiry using the following logic.
From the top frame, if I capture the submit event of the other 2 frames (right, main), then I can get the client's time while submitting the form. Using this I can calculate the idle time. But the problem is the onsubmit event triggers only for the SUBMIT button. In the application, we don't have SUBMIT button. (we are having only href links and buttons to submit the form using document.formname.submit()).
I am capturing the onsubmit event after the </FORM> tag as below.
<SCRIPT language="JavaScript1.2">
function mysubmit() {
alert('Load event fired!');
}
<!--
size = parent.frames.length-1;
for(j=1; j < size; j++){
menuFormName = parent.frames[j].document.forms[0].name;
alert('MENU FORM NAME : ' + menuFormName);
parent.frames[j].document.forms[0].onsubmit = mysubmit;
}
//-->
</SCRIPT>
Any ideas why onsubmit event is not triggered, if I do a document.formname.submit() from the javascript.
Regards
HC