Hi every one,
Iam using
struts in my application,
whenever I clicked on the refresh button of the browser the form is getting submitted twice.
I tried to use saveToken() and isTokenVaild() methods but still, the form is getting submitted when I click on the Refresh button.
please see my code below.
please let me know what is wrong with my code.
Thanks,
Madhu.
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
String forward = Constants.FWD_SUCCESS;
String action = mapping.getPath();
HttpSession session = request.getSession();
if(action.equals("/EdisTrees")){
EdisTreesHelper treeHelper = new EdisTreesHelper();
if(!isTokenValid(request)){
treeHelper.processTreesDeatils(mapping, form, request, response);
resetToken(request);
}else{
//do nothing;
}
}
saveToken(request);
return mapping.findForward(forward);
}