Пример #1
0
 protected LinkedList<Throwable> getStack() {
   Throwable e = exception;
   LinkedList<Throwable> stack = new LinkedList<Throwable>();
   while (e != null) {
     stack.addFirst(e);
     if (e instanceof NotFoundException) {
       status = HttpServletResponse.SC_NOT_FOUND;
     }
     if (e instanceof ServletException) {
       Throwable t = ((ServletException) e).getRootCause();
       if (t == null) t = e.getCause();
       e = t;
     } else if (e instanceof javax.servlet.jsp.JspException) {
       Throwable t = ((JspException) e).getRootCause();
       if (t == null) t = e.getCause();
       e = t;
     } else {
       e = e.getCause();
     }
   }
   return stack;
 }