1、自定义异常
SaveException,DeleteException,ModifyException
这是所有业务都可以用到的
UserinfoLoginException
这是和业务相关的
在显示异常页面的时候,所有的异常统一用一个页面显示
还是每个异常,单独一个页面显示?
SaveException,DeleteException,ModifyException
这是所有业务都可以用到的
UserinfoLoginException
这是和业务相关的
在显示异常页面的时候,所有的异常统一用一个页面显示
还是每个异常,单独一个页面显示?
定义在一个异常类里面?我现在是单独处理,SaveException,DelteteException等等。
然后在struts.xml里面这样定义<!--所有需要用到全局异常的package都需要继承globalException-->
<package name="globalException" extends="struts-default"> <!-- 此处定义所有的全局异常映射返回结果 -->
<global-results>
<result name="error">/erroreException.jsp</result>
</global-results> <!-- 此处定义所有的全局异常映射 -->
<global-exception-mappings>
<exception-mapping
exception="com.errors.SaveException" result="error" />
<exception-mapping
exception="com.errors.ModifyException" result="error" />
<exception-mapping
exception="com.errors.LoginErrorException" result="error" />
</global-假如程序抛空指针,数组下标越界,肯定不会跳转到error,这个时候该怎么处理?