> From: Krishnakumar N [mailto:[EMAIL PROTECTED]]
>
> I had sent this a query a while go, didn't get any responses.
> Now this is
> proving to be a thorny problem so here it goes again.
It's been my experience with various mailing lists that, if you don't get
any responses to a "how do I do this" question then that is usually an
indication that you can't (do that). This is becuase people generally only
write responses if they can answer in the positive; silence usually means a
negative.
But you'd really like confirmation, so I'll say that I don't think that
there is any way (with the current set of tags) to do what you want. The
manual "logic present" syntax you indicated for each field is the only way
that I've ever been able to do per field error messages.
>
> Using html:messages or logic tags, is it possible to group the error
> messages by each property which has errors attached to it and output a
> header, without explicitly coding a html:messages block for
> each property?
>
> I have a form which has several fields, which are validated
> in the Action
> class. These errors are added to the ActionErrors collection with the
> field's property name, for example,
> errors.add("myFirstField", new Action Error(...);
>
> Now, in the jsp, it is possible to produce an output such as
>
> Errors for My First Field
> <error1 text>
> <error2 text>
>
> Errors for My Third Field
> <error1 text>
>
> I would like to do this without repeating a
> <logic:messagesPresent property = "myFirstField">
> <bean:message key="myfirstfield.error.header" />
> <html:messages id="error" property="myFirstField">
> <bean:write name="error" />
> </html:messages>
> </logic:messagesPresent>
>
> block for each property in the form as (a) this would be
> error prone, we may
> miss to put this block for all the properties in the form and
> (b) if this
> can be done without reference to specific form's properties, then this
> generic code can be pulled into each page via some kind of include or
> template mechanism.
>
> I guess I am looking for something like
>
> <for each property which has errors>
> <get property name and output header for that property/>
> <output messages for that property/>
> </for>
>
> Is this possible with the standard tags? Thanks in advance
> for any hints.
>
> Cheers,
> Krishna
>
> --
> 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]>