我要做国际化,可是在jsp页面中使用<bean:message>出了点问题。总是抛出javax.servlet.jsp.JspException: Cannot find message resources under key dailyLogin。不知要如何解决
相关配置信息:
struts-config-dailyLogin.xml:
<message-resources key="dailyLogin" parameter="neusoft.ttc.dms.common.i18n.ApplicationResourcesDailyLogin_zh_CN.properties" />web.xml:
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/config/struts/struts-config-common.xml,
/WEB-INF/config/struts/struts-config-login.xml,
/WEB-INF/config/struts/struts-config-setting.xml,
/WEB-INF/config/struts/struts-config-dailyLogin.xml
</param-value>
</init-param>
<init-param>
                       <param-name>application</param-name>
                   <param-value>ApplicationResources</param-value>
                 </init-param>

解决方案 »

  1.   

    <message-resources key="dailyLogin" parameter="neusoft.ttc.dms.common.i18n.ApplicationResourcesDailyLogin_zh_CN.properties" />这里不应该带 .properties
    应该为:
    <message-resources key="dailyLogin" parameter="neusoft.ttc.dms.common.i18n.ApplicationResourcesDailyLogin_zh_CN" />调用时:
    <bean:message key="xx" bundle="dailyLogin"/>
      

  2.   

    <message-resources key="dailyLogin" parameter="neusoft.ttc.dms.common.i18n.ApplicationResourcesDailyLogin_zh_CN" /><bean:message  key="dailylogin.main.mainTitle" bundle="dailyLogin"/>
    改了,还是那错误
      

  3.   

    1.确认neusoft.ttc.dms.common.i18n.ApplicationResourcesDailyLogin_zh_CN 位置对不对。
    2.ApplicationResourcesDailyLogin_zh_CN 有没有加载。
      

  4.   

    错误变了:Missing message for key "dailylogin.main.mainTitle"
      

  5.   

    南京还是沈阳?大连?
    有没有dailylogin.main.mainTitle 检查一下啊。应该不难吧?
      

  6.   

    我是大连的。
    问一下.properties文件何时被加载?为何我已经更改了.properties文件中的value值,但是页面文字没有变化呢?还像还是用的原来的
      

  7.   

    properties文件何时被加载? --》 web容器初始化的时候。
    但是页面文字没有变化呢?  --》重启web容器即可。
      

  8.   

    郁闷啊,我的tomcat好像有问题,重启web容器也没效果,还有就是redeploy的时候有错误。
    Deploymen status:
    Deployment is out of date due to changes in the underlying project contents. You'll need to manually 'Redeploy' the project to update the deployed archive.
      

  9.   

    你的文件放的路径不对吧,放到编译出来的classes文件夹里面
      

  10.   

    tomcat好了可以正常redeploy了,是因为我的一个jar包有问题。但是还有那个问题就是我已经更改了.properties文件中的value值,但是页面文字没有变化。(重启也没用)
      

  11.   

    apache-tomcat-6.0.14\webapps\DMS-PetrolChina工程中是不是只存放WebRoot下的东西?
      

  12.   

    呵呵tomcat好了,问题也解决了,多谢各位了。