Struts 1.3 ActionErrors access

时光怂恿深爱的人放手 提交于 2019-12-11 03:14:46

问题


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;
}

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

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!


回答1:


ERROR_KEY in Globals; its value is "org.apache.struts.action.ERROR".



来源:https://stackoverflow.com/questions/8242712/struts-1-3-actionerrors-access

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!