dcsimg
The user submits the page and press the back button and submit the page again an error should be thrown(urgent)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ABHISHEK_SHRIVASTAVA
Posted On:   Friday, February 4, 2005 06:27 AM

hi.... I found the following methods in Action.java which I think may help to control the session ID. That means if the user submits the page and press the back button and submit the page again it will throw an error. generateToken(HttpServletRequest request) saveToken(HttpServletRequest request) isTokenValid(HttpServletRequest request) But even if I load my jsp page for the 1st time and submit the form it is forwarded to the error page,without pressing the back button on the browser. Am I missing something... please help me.....in debugging this error. My code sample in the LoginAction is as follows : generateToken(request); saveToken(request); if(isTokenValid(req)) {   More>>

hi....
I found the following methods in Action.java which I think may help to control the session ID. That means if the user submits the page and press the back button and submit the page again it will throw an error.

generateToken(HttpServletRequest request)
saveToken(HttpServletRequest request)
isTokenValid(HttpServletRequest request)

But even if I load my jsp page for the 1st time and submit the form it is forwarded to the error page,without pressing the back button on the browser.
Am I missing something...
please help me.....in debugging this error.
My code sample in the LoginAction is as follows :
generateToken(request);
saveToken(request);
if(isTokenValid(req)) {
resetToken(req);
} // end of isTokenTrue
else
{
err.add(ActionErrors.GLOBAL_ERROR,new ActionError("function.text"));
saveErrors(req,err);
return mapping.findForward("multiple_submit_err");
}

Thanks in advance,
Abhishek

   <<Less

Re: The user submits the page and press the back button and submit the page again an error should be thrown(urgent)

Posted By:   Ash_H  
Posted On:   Wednesday, February 9, 2005 08:11 AM

Hi,

Depends where you are generating the token....



In Action class

method1()//called before rendering the first jsp


//do the
if(isTokenValid(req)) { resetToken(req);

}
// end of isTokenTrue
else { err.add(ActionErrors.GLOBAL_ERROR,new ActionError("function.text"));


return mapping.findForward("multiple_submit_err");

}



method2()
//called once you submit
generateToken(req);

saveErrors(req,err);


Ash

About | Sitemap | Contact