• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionForward and token Help please....

 
Cory Max
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I am using tokens to stop the double post problem. My issue is that I dont want the second post to send them to a failure page. I want it to send them to the same page as the first post, but I only want the first post to affect the state of the objects on the server. Here is some code

public class PurchaseOrderAction extends DispatchAction
{
public ActionForward load(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
try
{ //save the token
saveToken(request)
// rest of the code for loading the form
}
catch(Exception ex){//exception}
}
//********************************************
public ActionForward submitOrder(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
try
{
// check the token. Proceed only if token is valid
if(isTokenValid(request,true)) {
//implement order submit functionality here
} else {
// i dont want to return a faliure here :-(
return mapping.findForward("failure");
}
}
catch(Exception ex){//exception}
}
}

Can anyone please help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic