读书人

请问 Struts 的 ActionErrors 使用异

发布时间: 2012-10-29 10:03:53 作者: rapoo

请教 Struts 的 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集合里了。

是不是还有其他的设置?




都能够正常显示。

读书人网 >Ruby Rails

热点推荐