[Opensource] Need a jsp snippet to loop through the ErrorColl
ection
Mike Traum
mtraum at cirnetwork.org
Fri Apr 11 13:00:34 PDT 2003
I would think it would be something like this:
<bean:define id="errors" type="org.apache.struts.action.ActionErrors"
name="org.apache.struts.action.ERROR"/>
<logic:iterate id="oneError" property="errors">
<bean:write name="oneError" property="key"/>
</logic:iterate>
but, the above doesn't work. Anyone know why?
It would be much better to have a custom taglib for this if you plan on
having this on multiple pages.
BTW, I would probably look at using a css style sheet for this anyway. It's
the better way to do it (unless you need to support really really old
browsers) and you can just use the regular ErrorTag taglib.
mike
-----Original Message-----
From: DComeau at xenos.com [mailto:DComeau at xenos.com]
Sent: Friday, April 11, 2003 11:22 AM
To: opensource at jcorporate.com
Subject: RE: [Opensource] Need a jsp snippet to loop through the ErrorColl
ection
Thanks for the reply Mike,
So there's no way to use JSTL to loop through the collection?
Basically what I am trying to do is build my own html table that holds the
messages.
There would be two columns, the left one holds a small image (to make the
messages look bulleted) and the right column holds the error message text
(in red).
I've already got that look working in other aspects of the design, so I'd
really love to get the errors working like that too.
I guess I could create a modified ErrorTag class, but I didn't think that
would be necessary?
-----Original Message-----
From: Mike Traum [mailto:mtraum at cirnetwork.org]
Sent: Thursday, April 10, 2003 4:46 PM
To: 'opensource at jcorporate.com'
Subject: RE: [Opensource] Need a jsp snippet to loop through the ErrorColl
ection
I would recommend copying com.jcorporate.expresso.ext.taglib.ErrorTag.java,
modifying it, and adding it as your own taglib.
If you have problems with that, describe exactly what you want to do and I
can give more help...
mike
-----Original Message-----
From: DComeau at xenos.com [mailto:DComeau at xenos.com]
Sent: Thursday, April 10, 2003 1:00 PM
To: opensource at jcorporate.com
Subject: [Opensource] Need a jsp snippet to loop through the ErrorCollection
Hi All,
This question is probobly pretty easy for me to figure out, but I couldn't
find anthing in the archives and I'm at "wrapping things up" stage of my
first expresso project, so I'd thought I'd just ask and save me :)
To get up and running, I used this tag:
<expresso:ErrorTag />
..but I now want to be able to loop through the errors myself and display
them in a different format.
Could somebody please post a snippet of Jsp code that loops through the
error collection? I really care how it does it, direct Java, JSTL, Struts
tags, whatever works!
Thanks,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.jcorporate.com/pipermail/opensource/attachments/20030411/3b2739aa/attachment-0002.htm
More information about the Opensource
mailing list