2011-03-11 43 views

回答

0

在struts项目中,通过使用ActionError对象来处理错误objet并通过使用ActionErrors对象来处理错误。

的假设

ActionError ae1=new ActionError("err.one"); 

ActionError ae2=new ActionError("err.two"); 

Action Errors aes=new ActionErrors(); 

aes.add(ae1); 

aes.add(ae2); 

saveErrors(request,aes);//store the errors object in request object 

处理异常:使用try和CACH块

2)使用声明的异常处理技术

处理利用全球例外

1) exceptons tag in struts-config.xml

每当例外将来到它执行gen.jsp页面。