Hi, My application requires that soon after the user logs in, some one-time tasks are to be performed (setting his login name, role in the session) and then he's to be presented with a welcome page. Now if he refreshes the welcome page, this initial tasks are run again. I've tried my best to stop it using saveToken and associates but in vain. Please help.
hi, u can take the help of a flag variable in ur jsp page/session , chk its value then go ... ok try this.
Joined: Apr 16, 2006
HI Eswar, Thanks very much but that's exactly what Struts does for me. The flag you are talking about is org.apache.struts.taglib.html.TOKEN which is set in the session and later the value sent through a request is checked against the one set in the session.
I am not sure about using tokens to solve this problem...it might work. My first thought is that you should have one action that does the initial login processing. That action should have a forward that passes control onto another action (say DisplayWelcome.do) with redirect set to true. When the user refreshes the page it will just call the DisplayWelcome action.
hello Abhijit, i faced the same problem. You can surely solve this problem using Tokens. The only thing required is that you should save that Token before loading that page. i mean in your code you have writtem saveToken and isTokenValid in same page. so isTokenValid always return false.saveToken must be before isTokenValid and on different page. Tell me if this is working or not.