How to alert user before session expires in Java?
In StackOverflow this question is discussed so many times. But my question is slightly different. I have a requirement to modify the existing application. My application is very big. Session will be expired after 30 mins if there is no response from the user. I want to display the alert before session expires, say at the 25th min I would like to display a prompt to user about session expires
In my application, more than 2000 jsp's are used and no common js is used. So I cannot change all the jsp file to include the javascript code for checking the session timeout.
How to handle this?
Create an iframe, and put the jsp pages inside there.
In the top page, that the iframe is within, then have javascript monitor for the jsp page changing (https://stackoverflow.com/a/1930942/67566).
If the jsp page hasn't changed in 25 mins you can warn the user.
If you are using ajax calls within your jsp pages then this will be more problematic, but the fact that you have so many jsp pages leads me to assume you aren't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With