ActionErrors   errors   =   null;     
  errors   =   new   ActionErrors();     
  errors.add("isExist",   new   ActionError("error.isExist"));   
// errors.add("isExist",   new   ActionError("error.isExist"));   等效于errors.add("isExist",   new   ActionMessage("error.isExist"));    
  saveErrors(request,   errors);   
  return   (mapping.findForward("failure"));   
failure页面里也定义了<html:errors   name="isExist"/>   
  ApplicationResources.properties里面也定义了error.isExist=user   have   already   exist!!!   
  运行结果 跳转到failure页面,显示“user   have   already   exist!!!   ”
ActionErrors.GLOBAL_ERROR 
怎么理解 
它和我们使用普通的字符有什么区别啊 
部分代码如下: 
err.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.logon")); 
err.add("errinfo", new ActionError("error.logon")); 
以上两名有什么区别啊 
没什么区别 
ActionErrors.GLOBAL_ERROR也是一个字符串。 最好写做ActionErrors.GLOBAL_ERROR 
不然的话可能会报错。 
	posted on 2006-12-20 18:03 
Super·shen BLOG  阅读(2611) 
评论(3)  编辑  收藏  所属分类: 
JAVA技术