No, I think I did not!
My validate Method looks like that, it returns Errors back to the
controller servlet.
- Where is the place to save the errors in the request???
public ActionErrors validate(ActionMapping pMapping,
HttpServletRequest pRequest)
{
System.out.println("VALIDIERE");
ActionErrors errors = new ActionErrors();
if (iBenutzer == null || iBenutzer.length() < 1)
{
errors.add("benutzungsname",
new ActionError("error.login.benutzername.required"));
}
if (iPasswort == null || iPasswort.length() < 1)
{
errors.add("passwort",
new ActionError("error.login.passwort.required"));
}
if (iSprache == null || iSprache.length() < 2 ||
iSprache.equals("blank"))
{
errors.add("sprache",
new ActionError("error.login.passwort.required"));
}
return errors;
}
Guus Holshuijsen schrieb:
>
> Do you save your errors?
>
> // Report any errors we have discovered
> if ( !errors.empty() )
> {
> saveErrors( request, errors );
> }
>
> Regards,
> Guus
>
> ----- Original Message -----
> From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 11:55
> Subject: Displaying errors when validating forms (ActionErrors)
>
> > Hallo,
> >
> > I have a problem to display ActionErrors. I use the validate-Method to
> > validate forms, like that:
> >
> > ------------------------------
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> > ActionErrors errors = new ActionErrors();
> > if (iBenutzer == null || iBenutzer.length() < 1) {
> > errors.add("benutzungsname", new
> > ActionError("error.login.benutzername.required"));
> > }}
> > ------------------------------
> >
> > But when I want to display that error, I can't see anything. Why?????
> >
> > * errors.header=<ul>
> > errors.footer=</ul>
> > error.login.benutzername.required=that is an error ...
> >
> > is in the property-file! That property-file is available (set in
> > web.xml)!
> >
> > * the JSP contains:
> > <html:errors/>
> > <html:errors property="benutzungsname"/>
> >
> > Who can help me?!
> > What is wrong??