1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| publicclass PurchaseOrderAction extends DispatchAction {
public ActionForward load(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)throwsException{
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)throwsException{
try{
// check the token. Proceed only if token is valid
if(isTokenValid(request,true)){
//implement order submit functionality here
}else{
return mapping.findForward("failure");
}
}catch(Exception ex){//exception}
}
} |
Partager