使用Spring Framework,如何将堆栈跟踪发送到错误页面以外?

时间:2011-09-19 15:03:22

标签: spring-mvc exception-handling

webxml

 <error-page>
    <error-code>405</error-code>
    <location>/support/405.jsp</location>
  </error-page>

<error-page>
    <error-code>500</error-code>
    <location>/support/500.jsp</location>
  </error-page>

  <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/support/500.jsp</location>
  </error-page>

   <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/support/500.jsp</location>
  </error-page>

如何将异常和throwable添加到多个错误页面

 <error-page>
    <error-code>405</error-code>
    <location>/support/405.jsp</location>
  </error-page>

**

<error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/support/405.jsp</location>
  </error-page>

   <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/support/405.jsp</location>
  </error-page>

**

<error-page>
    <error-code>500</error-code>
    <location>/support/500.jsp</location>
  </error-page>

  <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/support/500.jsp</location>
  </error-page>

   <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/support/500.jsp</location>
  </error-page>

0 个答案:

没有答案