cannot find message resources under key org.apache.struts.action.message 问题解决
来源:互联网 发布:淘宝联盟我的舞台 编辑:程序博客网 时间:2024/05/24 04:41
在学习logic标签的iterate时,老是报cannot find message resources under key org.apache.struts.action.message 的错:
源代码如下:
<%
HashMap hp = new HashMap();
String veg[] = {"tomato","pepper"};
String fruit[] = {"banana","apple","pair","orange"};
String flowers[] = {"chrysanthemum","rose"};
String trees[] = {"willow"} ;
hp.put("vegetable", veg);
hp.put("fruit", fruit);
hp.put("flowers", flowers);
hp.put("trees", trees);
request.setAttribute("hasmap",hp);
%>
<logic:iterate id="element1" name="hasmap" indexId="ind1" >
<bean:write name="ind1"/>...<bean:write name="element1" property="key"/><br>
<logic:iterate name = "element1" property="value" id="element2">
<bean:write name="element2"/><br>
</logic:iterate>
</logic:iterate>
解决办法:
上面代码是正确的。只是web.xml的设置有问题,在使用struts的标签时,比如bean标签,有时会发生这个错误。
错误原因:
web.xml中配置缺失:
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
造成原因:可能是JBuilder造成的,呵呵
解决方法:添加上,位置如下:
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
- cannot find message resources under key org.apache.struts.action.message 问题解决
- Struts Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE的错误
- 解决:Cannot find message resources under key org.apache.struts.action.MESSAGE的 方法
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- 时出现Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- Cannot find message resources under key org.apache.struts.action.MESSAGE
- javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action...
- 在做成绩查询时出现Cannot find message resources under key org.apache.struts.action.MESSAGE
- 新建个项目,显示long类型字段的时候报错:Cannot find message resources under key org.apache.struts.action.MESSAGE
- 使用struts的tag ,当对象的属性值为long的时候:org.apache.jasper.JasperException: Cannot find message resources under
- Struts Message Resources
- URL重写
- asp.net 2.0中设定默认焦点按钮
- Esri specialist 在社区中对ArcGIS9.2 xy domain设定进行修改的原因的经典描述
- JSF常用……
- ASP.Net2.0网站发布环境配置故障
- cannot find message resources under key org.apache.struts.action.message 问题解决
- eclipse配置j2me
- 简单文件IO
- 如何在英文ubuntu下安装中文输入法?
- js计算两个日期间的差
- 软件工程--需求分析与规格说明
- 如何禁止重复提交
- 小女子···
- python socket 编程手记