This need not be action class.But any where before adding error to the 
collection, u can check if there are any errors for the same key(which should 
be generally a property.)So this will work in your case only if u are doing 
validation only in one place.I mean U have already not added the action errors 
object previous to calling this code.

Any way as i have not used dynaActionForm, i cant tell anyy thing about 
that.But the code demonstrates how u can check for duplication of errors.So in 
your case, if u dont want to add the error for compulsory fields more than 3 
times, before adding the error each time u can check how many errors for the 
same key(e.g. error.field.missing) are there and then decide if u want to add 
or not.

And if u can take away this logic in a utility method,changing this tomorrow to 
have e.g. 5 errors will be easy.

regards,
Shirish


-----Original Message-----
From: vasilenko [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 4:47 PM
To: struts-user
Cc: vasilenko
Subject: Re: <html:errors/> question


As I understand this is for Action class.
In my sample i use DynaValidatorForm and
I must cath error in the jsp page.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 18, 2002 3:04 PM
Subject: RE: <html:errors/> question


> do some thing like...
> public static void logErrorOnce(ActionErrors errors, String errorKey) {
> if (errors.get(errorKey).hasNext() == false) {
> logError(errors, errorKey);
> }
> }
>
> -----Original Message-----
> From: vasilenko [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 1:52 PM
> To: struts-user
> Cc: vasilenko
> Subject: <html:errors/> question
>
>
>
> Dear,
>
> Describe:
> I have for example 10 form field (with validaton required). I see in the
> jsp(<html:errors/>) 10 errors when I try to inut ntohing.
>
> Question:
> I  want to see in the jsp only for example 3 errors.
>
>
> Best regards,
> Dmitry.
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to