• Post Reply Bookmark Topic Watch Topic
  • New Topic

message resource help!!  RSS feed

 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Reda Mokrane
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
Put your ApplicationResources under Classe's
and change
<message-resources parameter="com.xxx.ApplicationResources" null="false"/>

TO
<message-resources parameter="ApplicationResources"/>

Hope this help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!