You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "phil.noon@bigfoot.com" <ph...@hotmail.com> on 2003/09/16 14:01:42 UTC
Multiple message resource files
I am trying to use 2 message resource files in my application.
My struts-config.xml has:
<message-resources parameter="ApplicationResources" null="false" />
<message-resources parameter="MyWebAppResources" null="false" />
The errors are added in an Action bean with statements like:
errors.add("ToteNotFound", new ActionError("error.tote.toteNotFound"));
and displayed on the jsp with:
<html:errors/>
However, messages are only displayed from the last file listed in
struts-config.xml (in this example, from MyWebResources.properties). Any
message in the other file is not recognised and results in something like:
???en_US.error.tote.toteNotFound???
How do I persuade my application to display errors from either of two
files?
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multiple message resource files
Posted by Andrew Kuzmin <ku...@soft-ukraine.com>.
Hi,
struts-config.xml:
<message-resources parameter="ApplicationResources" null="false"
key="alternate"/>
<message-resources parameter="MyWebAppResources" null="false"/>
jsp:
<html:errors bundle="alternate"/>
--
Andrew Kuzmin
http://www.java201.com
----- Original Message -----
From: "phil.noon@bigfoot.com" <ph...@hotmail.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 3:01 PM
Subject: Multiple message resource files
> I am trying to use 2 message resource files in my application.
>
> My struts-config.xml has:
>
> <message-resources parameter="ApplicationResources" null="false" />
> <message-resources parameter="MyWebAppResources" null="false" />
>
> The errors are added in an Action bean with statements like:
>
> errors.add("ToteNotFound", new ActionError("error.tote.toteNotFound"));
>
> and displayed on the jsp with:
>
> <html:errors/>
>
> However, messages are only displayed from the last file listed in
> struts-config.xml (in this example, from MyWebResources.properties). Any
> message in the other file is not recognised and results in something like:
>
> ???en_US.error.tote.toteNotFound???
>
> How do I persuade my application to display errors from either of two
> files?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org