Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

quick question on actionerror constructor

 
Tony Smith
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ActionError constructor takes a string symbolic key that maps to the value in resource bundle. What happens if the key can't be found in the resource bundle? Do you get error message?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ActionError class has been deprecated, so don't use it. Use ActionMessage instead. In answer to your question, I believe that the error message will just be blank if there is no message with that key, and no exception is thrown.
 
Tony Smith
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ok, thanks. Do you know the main reason why it's deprecated?
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was confusioin when using ActionErrors and ActionMessages, so now there is only one with an indicator as to whether you want an error or messge.

PS - in the later vertsions of Struts you can indicate whether or not you are using a key that will be used for lookup in the MessagResources files or using a String literal that you want used instead of a lookup value
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic