You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Hohlen, John" <JH...@erac.com> on 2002/09/10 17:43:34 UTC
RE: ??? In JSP Error Message Using Struts 1.1 and Multiple Messag
e Re source Files
I solved part of the problem on my own problem. I shouldn't be using the
resource bundle in my code. The Struts framework figures which out messages
resource bundle to use based on the current sub-application being used.
Therefore, I changed my code to the following:
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.login.blankUserIdPassword"));
However, Struts still doesn't seem to find the value for my error message.
Now it displays the key:
Correct the following error(s):
???en_US.error.login.blankUserIdPassword???
Other internationalized text on my JSP is being correctly found in the
sub-application's message resource file as I use the "bundle" attribute in
my JSP custom tags. But the action errors code doesn't seem to be finding
the message resource bundle.
-----Original Message-----
From: Hohlen, John
Sent: Tuesday, September 10, 2002 9:35 AM
To: Struts-Help (E-mail)
Subject: ??? In JSP Error Message Using Struts 1.1 and Multiple Message
Re source Files
I'm currently seeing "????" in my error messages using the <html:errors> tag
in Struts 1.1 (b2) with multiple message resource files. For example, I see
the following:
Correct the following error(s):
???en_US.Please enter user ID and password.???
I understand the "???" will appear when an unknown message key is used if
you have null set to "false" in the message-resources declaration. For
example:
<message-resources key="LOGIN_MESSAGES_KEY"
parameter="com.abc.training.LoginMessages"
null="false"/>
However, the message key is being found because "Please enter user ID and
password" is the correct "value" for the key. More specifically, my
"com.abc.training.LoginMessages" file has the following key/value:
error.login.blankUserIdPassword = Please enter user ID and password.
My Java code poplulates the errors container as follows:
ActionErrors errors = new ActionErrors();
ResourceBundle bundle =
ResourceBundle.getBundle("com.abc.training.LoginMessages");
errors.add(ActionErrors.GLOBAL_ERROR,
new
ActionError(bundle.getString("error.login.blankUserIdPassword")));
Any ideas on why I'm seeing the "???" if the key is being successfully
found?
Thanks,
JOHN HOHLEN
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>