code: public static void throwServletException(Throwable cause)
              throws ServletException
      {
          ServletException servletException = new ServletException(cause);
  
          // todo: future cleanup
          // the servlet 2.5 api sets does the equivalent of initCause in its constructor
          // where the servlet 2.4 api does not, so check for the 2.5 behavior before setting initCause
          if (servletException.getCause() == null) {
              servletException.initCause(cause);
          }
          throw servletException;
      }
docs: This initializes the 'cause' on the exception before throwing it; otherwise, the chain of exceptions is hidden
  because of legacy behavior in ServletException ('rootCause' vs. 'cause').