| Author |
Cannot find message resources
|
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
|
|
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
Joined: Feb 15, 2005
Posts: 4864
|
|
|
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.
|
Merrill
Consultant, Sima Solutions
|
 |
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
|
|
|
ok, it works. i remove the key and it work. thanks for your help.
|
 |
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
|
|
|
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
Joined: Feb 15, 2005
Posts: 4864
|
|
|
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.
|
 |
 |
|
|
subject: Cannot find message resources
|
|
|