可以编写action时,声明
public String execute()throws Exception{
//not try,catch
throw new Exception()
}
程序里面不要捕获异常,直接抛出异常
然后根据 <global-results>
<result name="error">/jsp/error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
就能看到声明错了,便于调试,
如果在程序里用了try catch,可以看不到错误就跳到结果了