Struts 1.3 ActionErrors 访问 [英] Struts 1.3 ActionErrors access

查看:30
本文介绍了Struts 1.3 ActionErrors 访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 ActionForm 中,我有验证方法:

In my ActionForm i have the validate method:

public ActionErrors validate(ActionMapping mapping, HttpServletRequest request){

    ActionErrors errorList = new ActionErrors();
    errorList.add("myError", new ActionMessage("this is my error"));
    return errorList;
}

然后流程会返回到页面 form.jsp.

Then the flow will be returned to the page form.jsp.

我想从我的 form.jsp 页面访问该错误,但使用 JSTL 的 EL 而不是 html:error标签.我知道 errorList 作为属性存储在请求范围内,但我需要该属性的确切名称.您能说出存储在请求中的 errorList 以什么名称命名吗?谢谢!

I want to access that error from my form.jsp page but using JSTL's EL and not html:error tag. I know that errorList is stored as an Attribute on the requests scope but I need the exact name of the attribute. Can you tell under what name is that errorList stored on the request? Thank you!

推荐答案

全局变量中的 ERROR_KEY;它的值为 "org.apache.struts.action.ERROR".

这篇关于Struts 1.3 ActionErrors 访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆