• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Struts: ActionMessage vs. Action Error

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read in one book that ActionError is being deprecated in favor of ActionMessage. Another book mentions nothing of this. Is it so? Should I convert my ActionErrors to ActionMessages?

Can you put an Action Error in ActionMessages? If so, how do you pull only errors or messages out?

Thanks,

Jess
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I read in one book that ActionError is being deprecated in favor of ActionMessage. Another book mentions nothing of this. Is it so? Should I convert my ActionErrors to ActionMessages?

Can you put an Action Error in ActionMessages? If so, how do you pull only errors or messages out?

Thanks,

Jess



Hi,

It is true that ActionError is being deprecated in favour of ActionMessage, unfortunately the validate method of ActionForm still returns the ActionError object, so to work around it what you can do is instead of putting the ActionErrors objects into ActionErrors, put the ActionMessage objects.



and to access this errors in the jsp page use this code



Cheers
 
Jessica Doe
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic