aspose file tools*
The moose likes Struts and the fly likes return type of ActionMessages validate(... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "return type of ActionMessages validate(..." Watch "return type of ActionMessages validate(..." New topic
Author

return type of ActionMessages validate(...

Matthew Anderson
Greenhorn

Joined: Jul 03, 2007
Posts: 9
Since ActionErrors validate(... has been replaced with ActionMessages validate(... my code doesn't accept same return type as before. I.e. ActionMessages e = new ActionMessages();
e.add("error", new ActionMessage("error"));
return e;

doesn't work, anyone know why?
Ram Chhabra
Greenhorn

Joined: Jun 23, 2007
Posts: 23
Which version of Struts are you using
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by Code Exception:
Since ActionErrors validate(... has been replaced with ActionMessages validate...

Not true. In all versions of Struts 1 the return type of the ActionForm's validate method is ActionErrors, just as it has always been. You can verify this for yourself by reading the documentation for the ActionForm class in the Struts 1.3.8 Javadoc.

What may be confusing you is that the class ActionError (No "s" on the end) has been deprecated in favor of ActionMessage. ActionErrors, however, has not been deprecated.
[ July 19, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: return type of ActionMessages validate(...