This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi together, my problem is as follows i have a login.jsp (username,password) when i entered this information and click on submit the form sends that data to my FrontServlet(part of my FrontController).This FrontServlet forward this information to my LoginHandler (normal class)wich checks the username and password. When it is ok, my LoginHandler creates a new session and sets (setAttribute()) a loginOK into the session. then the Loginhandler starts my ServiceDispatcher who display the requested site to the user. EVERYTHING WORKS FINE. BUT, when the session is timed out, and i click on the refresh button the browser sends the login information (username,password) again to my FrontServlet wich repeats the login-procedure and displays the site again, with a new created session. That is not what i want. I want that when the session is timed out a relog-page(simple html page) should be displayed("Session is timed out, please relog!!"). Does anybody know what my problem is?? thank you in advance Hrvoje Canzek (HOWY)
Dear Hrvoje Canzek, When u refresh yr page at browser is same as that u enter yr username and password again and create another session. But a solution for yr problem may be this: Set one variable in yr session (say login name). Then, write one class who extends SessionBindingEvent Listener. In this class override valueUnbound() method. So, what happens now is, When yr session will timeout Container will call method valueUnbound() on this class. Now, In this valueUnbound() method, redirect / forward the request to yr login page. Hope this helps, Best regards, Dharmin
SCJP2 (93%),SCWCD(88%)<br />-------------------------------<br />Never under estimate yr self, just represent yr profile in proper manner.
Dharmin, Please change your name to be compliant with JavaRanch's naming policy. Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name. You can change your name: here. Thanks, Cindy
"JavaRanch, where the deer and the Certified play" - David O'Meara