您的位置:首页 > 运维架构 > Apache

新建个项目,显示long类型字段的时候报错:Cannot find message resources under key org.apache.struts.action.MESSAGE

2009-07-29 16:50 507 查看
新建个项目,显示long类型字段的时候报错:Cannot find message resources under key org.apache.struts.action.MESSAGE

下面方法可以解决:

在struts-config.xml中添加如下的配置:

<message-resources parameter="ApplicationResources"/>

如果出现“Cannot find message resources under key org.apache.struts.action.MESSAGE”,是说明未找到ApplicationResources.properties,要注意三方面设置。
  第一:在web.xml适当位置要有如下设置:

<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>

  第二:在struts-config.xml中适当位置要有如下设置:

<message-resources parameter="ApplicationResources"/>

  第三:确保ApplicationResources.properties文件在你建立的WEB-INF\classes目录中,而且其中有关于index.title的设置(当然,以你要提取的key名称为准)。

  另外说明,你也能把ApplicationResources.properties放到classes目录下其他目录,同时修改struts-config.xml中的对应设置。例如:
 将“ApplicationResources.properties”放入WEB-INF\classes\test目录下。struts-config.xml中的对应设置:

<message-resources parameter="test/ApplicationResources"/>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐