Hi Jeff,
I've done the following. It's not the prettiest, but it works (although I
haven't tested it on errors generated from the perform() method, only
validate()).
 
<logic:present name="org.apache.struts.action.ERROR">
<bean:define id="errors" name="org.apache.struts.action.ERROR"
type="org.apache.struts.action.ActionErrors"/>
<logic:iterate collection="<%errors.get()%>"
type="org.apache.struts.action.ActionError" id="anError">
.....html......
.....html......
<bean:message key="<%=anError.getKey()%>"/>
.....html......
.....html......
</logic:iterate>
</logic:present>
 
If anyone knows a prettier method, I'd be interested in it too :-)
 
Hope this helps.
Regards
David
 

-----Original Message-----
From: Jeff Trent [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 14:25
To: [EMAIL PROTECTED]
Subject: Re: Override the presentation of html:errors


Yes, this helps.  I need to next research how to do that ;^)
 

----- Original Message ----- 
From: Natra,  <mailto:[EMAIL PROTECTED]> Uday 
To: '[EMAIL PROTECTED]'
<mailto:'[EMAIL PROTECTED]'>  
Sent: Tuesday, May 01, 2001 9:39 PM
Subject: RE: Override the presentation of html:errors

When U add Ur errors to the ActionErrors Collection in the perform() method
of the Action class, An object of type ActionErrors is saved in the request
with a key name "ERROR_KEY". There is a method on the ActionErrors class
called "get()" that returns a Iterator for a collection of ActionError
objects. You can use the Struts iterator tag to display the errors in Ur own
manner. Hope this helps.
 
Thanks,
Uday. 

-----Original Message-----
From: Jason Chaffee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 5:43 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Override the presentation of html:errors


The best way to handle errors is to name them separatly and then access each
one indiviually in your jsp.  See the Java docs for more info on error
handling.  It covers this approach quite well.

-----Original Message-----
From: Jeff Trent [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 1:36 PM
To: [EMAIL PROTECTED]
Subject: Override the presentation of html:errors


Short of writing my own taglib (which I'd like to avoid if I can), how does
one iterate over the errors collection to present them in a different way.
Any examples would be helpful...
 
Thanks,
Jeff
 


************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************

Reply via email to