我的jsp: <html:messages id= "message " property= "filename " message= "true ">
<bean:write name= "message "/>
</html:messages>
action:if(filename.indexOf( ".txt ") < 0) {
actionMessages.add( "filename ", new ActionMessage( "filename is not textfile ",filename));
saveMessages(request, actionMessages);
System.out.println( "---filename is not textfile--- ");
return (new ActionForward(mapping.getInput()));
}
运行后错误信息:root cause
javax.servlet.jsp.JspException: Cannot find bean message in any scope
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:992)
org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:227)
org.apache.jsp.index_jsp._jspx_meth_bean_write_0(org.apache.jsp.index_jsp:260)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:143)
请各位路过的达人看看
------解决方案--------------------
大哥 你配置 .properties了吗?
------解决方案--------------------
你的Action写的有问题啊,既然massage不在任何cope内,那就说明在jsp页面就根本没有.
这样的话,就是你Action里面根本就没有把massage保存到cope内.
你再检查检查
------解决方案--------------------
把property去掉