<html:errors/> only display error messages returned from
validate() method of FormAction class but not from
execute() method of Action class.
How do I display ActionError that are created in execute() method of Action class?
LoginAction class
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)
throws Exception {
UserManager um = UserManager.getInstance();
String username = ((LoginForm)form).getUsername();
String password = ((LoginForm)form).getPassword();
ActionErrors errors = null;
if (um.login(req.getSession(), username, password) == null) {
errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.login.loginfailed"));
saveErrors(req, errors);
return mapping.findForward("Failure"); }
return mapping.findForward("Success");
}
[ September 10, 2002: Message edited by: Chu Tan ]
[ September 10, 2002: Message edited by: Chu Tan ]