You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Justin Forys <Ju...@travelersla.com> on 2001/03/13 21:07:41 UTC

Getting the tag to display on multiple lines

Hello,

I guess this is kind of a trivial question, but I'm having a problem getting
the
"html:errors" tag to display on multiple lines for multiple errors. Am I
overlooking
something obvious, or do I have to use the iterator tag and parse the errors
myself if
I want them on separate lines? If you could respond directly to me at: 

justin.forys@travelers.com

Thanks
Justin

Re: Getting the tag to display on multiple lines

Posted by Michael McCallister <r2...@email.sps.mot.com>.
Just specify the property attribute of the html:errors tag.  So, for 
example, in your validate function you might have something like:

             errors.add("roles", new 
ActionError("error.reqaccess.role.invalid"));

to indicate an error in the "roles" field.  Using:

         <html:errors property="roles"/>

in your JSP will show only the errors associated with the roles 
field.  Repeat this for as many fields as you have and use the appropriate 
parameters to errors.add(), and you should be able to place errors in the 
appropriate locations.


Mike

At 02:12 PM 3/13/2001, you wrote:
>Hello,
>
>I guess this is kind of a trivial question, but I'm having a problem getting
>the
>"html:errors" tag to display on multiple lines for multiple errors. Am I
>overlooking
>something obvious, or do I have to use the iterator tag and parse the errors
>myself if
>I want them on separate lines? If you could respond directly to me at:
>
>justin.forys@travelers.com
>
>Thanks
>Justin