You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by wo_shi_ni_ba_ba <wo...@yahoo.com> on 2005/03/12 02:53:25 UTC

message-resource help!

hi folks,
I am trying to use error message specified in the
application resources
I specified the following name=pair:
newunit.failure = Failed to create a new {0}: <br> {1}
and then in my Action class I added an error like
this:
errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("newunit.failure", "project",
e.getMessage()));

The error is returned on my html page like this:
???en_US.newunit.failure??? 
which probably means struts can't find and  associate
the application resources,
I did specify the message-resource in struts-config
<message-resources
parameter="com.xxx.ApplicationResources"
null="false"/>
do I need to programtically use MessageResource class
to obtain the my error message? os is there an easier
way I missed?
thanks in advance



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: message-resource help!

Posted by Manfred Wolff <wo...@manfred-wolff.de>.

How did you name your ressource-file and on which directory did you 
place it?

Manfred

wo_shi_ni_ba_ba wrote:

>hi folks,
>I am trying to use error message specified in the
>application resources
>I specified the following name=pair:
>newunit.failure = Failed to create a new {0}: <br> {1}
>and then in my Action class I added an error like
>this:
>errors.add(ActionErrors.GLOBAL_ERROR, new
>ActionError("newunit.failure", "project",
>e.getMessage()));
>
>The error is returned on my html page like this:
>???en_US.newunit.failure??? 
>which probably means struts can't find and  associate
>the application resources,
>I did specify the message-resource in struts-config
><message-resources
>parameter="com.xxx.ApplicationResources"
>null="false"/>
>do I need to programtically use MessageResource class
>to obtain the my error message? os is there an easier
>way I missed?
>thanks in advance
>
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Yahoo! Small Business - Try our new resources site!
>http://smallbusiness.yahoo.com/resources/ 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org