Hey,
 
Looking through the archive I found a couple of notes about internationalizing the ActionError parameters.  I'm talking about the following:
 
public ActionError(java.lang.String key,
                   java.lang.Object value0,
                   java.lang.Object value1)
Construct an action error with the specified replacement values.
Parameters:
key - Message key for this error message
value0 - First replacement value
value1 - Second replacement value
 
What I want to do is pass in keys from the properties file into the second and third parameter.  Specifically I want to pass in the prompt keys to display to the user the fields that are in error.
 
One possible solution proposed was by Craig as follows:
 
The java.text.MessageFormat class (which is how Struts is doing the
substitution) does not support internationalizing the replacement
parameters directly.  But how about doing this in two steps?

* Look up the internationalized replacement value from
  a MessageResources bundle

* Use the returned String as the replacement value in the
  ultimate message.
However, I need to get the locale somehow.  It seems alot easier to just override ActionError to accept keys as parameters.  Has anyone overridden the ActionError class to accept "java.lang.String key" parameters instead of "java.lang.Object value0"?

Kyle Robinson
Systems Consultant
Pangaea Systems Inc.
(250) 360-0111

"Work joyfully and peacefully, knowing that right thoughts and right efforts inevitably bring about right results." - James Allen

 

Reply via email to