Following the examples that come with WW2 (<ww:iterator
value="actionErrors"> ...) I use ActionSupport's actionErrors property for
communicating errors to the user. Actually I found this feature so neat that
I added an actionMessages property to my Action base class derived from
ActionSupport since sometimes I have some more in store form my users than
only error messages ;) This works like a charm unless I chain actions, which
I do quite often. In these cases the actionErrors and actionMessages
properties will get lost. Is there an elegant solution to this problem?

In the wiki there is a post from Robert Douglass proposing to put something
like

<result name="success">browse.action?id=${product.id}</result>
(=> <result
name="success">chained.action?actionErrors=${actionErrors}</result>)

in xwork.xml. I found out that I can retrieve those errors by means of

String[] actionErrors = (String[])
ActionContext.getContext().getParameters().get("actionErrors");

(substituting the expected Collection for String[] always failed with a
class cast exception). Yet there might be a more elegant way to achieve what
I am trying to do. If so I would be glad to hear about it.



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to