struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: displaying non-localized erorr messages
Date Sat, 11 Nov 2006 01:35:16 GMT
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


Mime
View raw message