FileDocCategorySizeDatePackage
CheckTokenAction.javaAPI DocExample1059Tue Jun 29 07:36:44 BST 2004com.oreilly.strutsckbk.ch06

CheckTokenAction

public class CheckTokenAction extends org.apache.struts.action.Action

Fields Summary
Constructors Summary
Methods Summary
public org.apache.struts.action.ActionForwardexecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

		if (isTokenValid(request)) {
			// reset the token
			resetToken(request);

			// save data
			BusinessService.saveData();
		}
		else {
			ActionErrors errors = new ActionErrors();
			errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Invalid token"));
			saveErrors(request, errors);
			return new ActionForward(mapping.getInput());
		}
		return mapping.findForward("success");