This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

return type of ActionMessages validate(...  RSS feed

 
Matthew Anderson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Struts are you using
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!