K
Klaus
I have an error message like "{0} is ..." (Resources).
See code below:
The part "key.x.z" is taken from the resource bundle (fine)
The replacment {0} is displayed as it is: "key.x.label" (bad)
=> How can I make the second part being internationlized too?
I work-around the problem by manually getting the bundle by using
PropertyResourceBundle. I do not like it, because when I change the
resource bundle in struts-config.xml the Java code becomes
inconsistent with the config file.
Possible solutions:
Directly access the default bundle from within validate, but how?
Code Example:
=============
public ActionErrors validate(ActionMapping m, HttpServletRequest r) {
ActionErrors errors = new ActionErrors();
if (....)
errors.add("person", new ActionError("key.x.z", "key.x.label"));
return errors;
}
See code below:
The part "key.x.z" is taken from the resource bundle (fine)
The replacment {0} is displayed as it is: "key.x.label" (bad)
=> How can I make the second part being internationlized too?
I work-around the problem by manually getting the bundle by using
PropertyResourceBundle. I do not like it, because when I change the
resource bundle in struts-config.xml the Java code becomes
inconsistent with the config file.
Possible solutions:
Directly access the default bundle from within validate, but how?
Code Example:
=============
public ActionErrors validate(ActionMapping m, HttpServletRequest r) {
ActionErrors errors = new ActionErrors();
if (....)
errors.add("person", new ActionError("key.x.z", "key.x.label"));
return errors;
}