public class LoginAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws Exception {
// check the username LoginForm form = (LoginForm) actionForm; if (form.getUsername().equalsIgnoreCase("sam") && form.getPassword().equals("password")) { // we are in return actionMapping.findForward("success"); } else { // not allowed return actionMapping.findForward("failure"); } } public ActionErrors validate(ActionMapping actionMapping HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors();