Re: Action re-running on page refresh?
Hi Kat , You Have to put th URL value in the session say NEXTURL for this you have to write one JSP in which you will say amon.jsp String nextUrl = session.getValue("NEXTURL") ; String page = session.getValue("Page") ; response.sendRedirect(nextUrl) ; in every jsp in the application you have to say String requesturl = request.getRequestURI() ; and session.puValue("NEXTURL",requesturl ); somewhere in jsp or action class response.redirect("amon.jsp?Page=MyPage.jsp"); which will return the complete uri to you and once you thru with the login validations and all then redirect to the above intermidiate.jsp in this way you are never redirecting to your original page always to intermediate and whatever session values will be there it will get redirected to that jsp page. so never login. This method is tested one... abhijeet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action re-running on page refresh?
I think using redirect="true" for your success action-foward will get what you want. -Original Message- From: Kat Luna [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 08:24 To: [EMAIL PROTECTED] Subject: Action re-running on page refresh? Hi! I'm just starting with Struts and have gotten myself stuck already :) I'm building a login application. In the LoginAction, depending on what username and password were entered, the user is forwarded to one of 5 possible pages. However, from this point on, xx/login.do is always in the URL address bar, and if the user ever refreshes the page, the LoginAction runs again. Since we do not allow concurrent logins, this boots the user out of the application. So my question is how do I prevent LoginAction from ever running again, once the user has been forwarded to the next page? I've tried adding various redirects between the LoginAction and the following page, but nothing seems to work. Even if the user logs out and then uses the back button, the username and password is still held in the request, and they can then login again just be refreshing the page. Is this happening because the user is never more than a single page/request from Login? How can I prevent this? thanks, Kat __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action re-running on page refresh?
Hi! I'm just starting with Struts and have gotten myself stuck already :) I'm building a login application. In the LoginAction, depending on what username and password were entered, the user is forwarded to one of 5 possible pages. However, from this point on, xx/login.do is always in the URL address bar, and if the user ever refreshes the page, the LoginAction runs again. Since we do not allow concurrent logins, this boots the user out of the application. So my question is how do I prevent LoginAction from ever running again, once the user has been forwarded to the next page? I've tried adding various redirects between the LoginAction and the following page, but nothing seems to work. Even if the user logs out and then uses the back button, the username and password is still held in the request, and they can then login again just be refreshing the page. Is this happening because the user is never more than a single page/request from Login? How can I prevent this? thanks, Kat __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]