This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes quick question on actionerror constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "quick question on actionerror constructor" Watch "quick question on actionerror constructor" New topic

quick question on actionerror constructor

Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
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

Joined: Feb 15, 2005
Posts: 4864
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.

Consultant, Sima Solutions
Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
Oh ok, thanks. Do you know the main reason why it's deprecated?
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
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
I agree. Here's the link:
subject: quick question on actionerror constructor
It's not a secret anymore!