请问 Struts 的 ActionErrors 使用,异常消息未何不输出
请教 Struts 的 ActionErrors 使用,错误消息未何不输出
代码片断如下:
Action Bean 里的:
其中 failure 指向 error.jsp,如下:
error.jsp 代码片断:
为什么输出总是空的消息,跟踪代码,错误对象已经生成在ActionErrors集合里了。
是不是还有其他的设置?
代码片断如下:
Action Bean 里的:
/* 添加错误 */ errors.add(r.getMsg(), new ActionError(r.getMsg())); saveErrors(httpServletRequest, errors); return actionMapping.findForward("failure");
其中 failure 指向 error.jsp,如下:
<action ....> .... <forward name="success" path="/result.jsp"/> <forward name="failure" path="/error.jsp"/> </action>
error.jsp 代码片断:
<td style="PADDING-left:12px;"> <html:errors/><br> </td>
为什么输出总是空的消息,跟踪代码,错误对象已经生成在ActionErrors集合里了。
是不是还有其他的设置?
1 楼
datuz
2007-02-07
其它的struts标记能正常显示吗
2 楼
gis9
2007-02-07
其他的Struts标签都能正常显示,例如:
<html:button property="isee" styleClass="button" onclick="javascript:history.go(-1);"><bean:message key="gis9.oktext"/></html:button>
都能够正常显示。
<html:button property="isee" styleClass="button" onclick="javascript:history.go(-1);"><bean:message key="gis9.oktext"/></html:button>
都能够正常显示。