1、自定义异常
   SaveException,DeleteException,ModifyException
   这是所有业务都可以用到的
   UserinfoLoginException
   这是和业务相关的
在显示异常页面的时候,所有的异常统一用一个页面显示
还是每个异常,单独一个页面显示?
  

解决方案 »

  1.   

    SSH 项目可以指定一个 erro 页面 在web.xml 里面配置一下 工程所有的都错误都会转到erro 页面 具体的可以上百度搜索  我电脑里面有列子 可惜我不在家 现在
      

  2.   

    用struts设置一个全局接收异常的,统一用一个页面显示。用户没必要知道什么异常,知道是异常就可以了。
      

  3.   


    定义在一个异常类里面?我现在是单独处理,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,这个时候该怎么处理?