Meaningless Drivel is fun!*
The moose likes Struts and the fly likes ActionForward and token Help please.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionForward and token Help please...." Watch "ActionForward and token Help please...." New topic
Author

ActionForward and token Help please....

Cory Max
Ranch Hand

Joined: Jul 20, 2005
Posts: 83
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?


There are only 10 types of people in this world... Those who understand binary and those who don't.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ActionForward and token Help please....
 
Similar Threads
Some problem with local Forward
execute method
Can not forward from BaseAction
how would I check if there are errors in Action execute method
Performance Issue