DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29679>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29679

Validator returns ActionErrors instead of ActionMessages





------- Additional Comments From [EMAIL PROTECTED]  2004-06-18 22:17 -------
The way you explain it makes perfect sense.

In practice though... (I'm going to use the phrase "special type" instead 
of "subclass" so it's more obvious as to why this is confusing).

ActionErrors are special types of ActionMessages. Neither is deprecated. They 
contain elements of ActionMessage (singular)

Since an ActionError (singular, deprecated) is a special type of ActionMessage, 
both can be added to instances of ActionErrors or ActionMessages (plural)

So nevermind that you can add ActionError (singular) to ActionMessages (plural) 
and that Action.saveErrors() and Action.saveMessages works on *both* accept 
ActionErrors and ActionMessages (plural) as arguments...

And also nevermind that both the phrase "ActionError" and "ActionMessage" have 
classes with "pluralized" and "singular" versions you need to try and keep 
straight and aren't intuitively used...

And also forget that it would be easier if you could just ignore the 
ActionErrors class entirely, but you can't because Form.Validate() returns it 
and it would break things to change it...

But the thing that just kills me here is that message="true" is what you use to 
say that the objects (whatever they are) in an instance of ActionMessages are 
NOT ERRORS. So ActionMessages are by default considered "errors" and 
not "messages". 

I would think the default, the objects contained in an ActionMessages (plural) 
are to be used as "messages" and not "errors" (or else the class is badly 
named). I know why it's done. Because people used them as errors before and we 
didn't want to hurt them.

Am I adequately explaining the pandora's box here? 
 
Is there any way we could give people a struts-config declaration that would 
make the framework call a Form.validate() method that returns ActionMessages 
instead? This way you've provided a path that makes sense for legacy apps, and 
a way that makes sense for the future.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to