标题:关于 saveErrors
只看楼主
lewis0323
Rank: 2
等 级:新手上路
威 望:3
帖 子:102
专家分:0
注 册:2006-7-20
 问题点数:0 回复次数:1 
关于 saveErrors

import 要用文件.*
public final class DisplayAllAction extends AbstActionBase {

private Log log =
LogFactory.getLog(this.getClass().getName());

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

Locale locale = getLocale(request);
MessageResources messages = getResources(request);

ActionMessages errors=new ActionMessages();

if (!errors.isEmpty()) {
saveErrors(request, errors);
return (new ActionForward(mapping.getInput()));
}

String strSql = new String("SELECT * FROM " + Constants.TABLENAME + " ORDER BY ID");
HttpSession session = request.getSession();
session.setAttribute(Constants.SQLSTMT_KEY, strSql);

return (mapping.findForward(Constants.FORWARD_SUCCESS));

}
}

请问这里为什么不能用 saveMessage(request, errors);?????????
显示
The method saveErrors(HttpServletRequest, ActionErrors) in the type Action is not applicable for the arguments (HttpServletRequest, ActionMessages)

搜索更多相关主题的帖子: saveErrors public form request Locale 
2006-11-13 20:38
lewis0323
Rank: 2
等 级:新手上路
威 望:3
帖 子:102
专家分:0
注 册:2006-7-20
得分:0 

找到错误了 定义错了 应该是
ActionErrors errors =(ActionErrors) new ActionMessages();

2006-11-13 20:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-102713-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023887 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved