You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Youssef A. Mohammed" <ya...@ejada.com> on 2006/11/09 20:11:51 UTC
displaying non-localized erorr messages
Hi all;
There is a requirement to display a message that are retrieved from the
backend system without the need to localize it tin the MessageResource
files.
That's the backend system will return a dynamic error message "ERROR 1 2 3"
and I just want to display this using the html:errors tags in my jsp!
How can I do that?
Regards,
Re: displaying non-localized erorr messages
Posted by Laurie Harper <la...@holoweb.net>.
Youssef A. Mohammed wrote:
> Hi all;
>
> There is a requirement to display a message that are retrieved from the
> backend system without the need to localize it tin the MessageResource
> files.
>
> That's the backend system will return a dynamic error message "ERROR 1 2 3"
> and I just want to display this using the html:errors tags in my jsp!
>
> How can I do that?
Create an ActionMessage using the constructor that takes a boolean
argument to specify that the message is not a resource key:
ActionMessage msg = new ActionMessage("my error text", false);
Then add it to your ActionErrors (or ActionMessages) collection as
usual. See the ActionMessage API documentation [1] for details.
L.
[1]
http://struts.apache.org/1.x/struts-core/apidocs/org/apache/struts/action/ActionMessage.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org