• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find message resources

 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i having the error: Cannot find message resources under key org.apache.struts.action.MESSAGE. Below are my jsp code, and my struts-config.xml

struts-config.xml
<message-resources key="labels" parameter="com/web/Label"/>
<message-resources key="messages" parameter="com/web/Message"/>

jsp page:
<logic:iterate id="Message" name="lMessage" type="com.pojo.ThreadMessage">
<bean:write name="Message" property="id"/> </logic:iterate>

i try to remove the bean:write, and my page can be display. once i put that line, i will have the error.

what is wrong, and how should i solve it?

thanks.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must define a default message-resources bundle without a key attribute. Either remove the key attribute from one of the ones you have defined to make it the default, or add a new resource that will be the default.
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, it works. i remove the key and it work. thanks for your help.
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but why is it that i have to remove that? if without the key, then how am i going to identify which properties files to call?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bundle without the key is the "default" bundle, which means it will be used any time you don't specify a "bundle" attribute in a <bean:message> tag. If you want to use the bundle with the key, specify that key in the budle attribute of a <bean:write> tag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic