Package org.bzdev.net

Class ServletAdapter.ServletException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.bzdev.net.ServletAdapter.ServletException
All Implemented Interfaces:
Serializable
Enclosing interface:
ServletAdapter

public static class ServletAdapter.ServletException extends Exception
ServletAdapter Exception. This class is provided to match the servlet specification In a Servlet implementation, it should be converted to the exception javax.servlet.ServletException (the name similarity serves as a reminder and simplifies code migration).

When a servlet catches this exception, the exception should be converted to a ServletException. For example


     try {
       ...
     } catch (ServeletAdapter.ServletException e) {
           ServletException se =
             new ServletException(e.getMessage(), e.getCause());
             se.setStackTrace(e.getStackTrace());
             throw se;
     }
 
See Also:
  • Constructor Details

    • ServletException

      public ServletException(String msg)
      Constructor given an error message.
      Parameters:
      msg - the error message for this exception
    • ServletException

      public ServletException(String msg, Throwable cause)
      Constructor given an error message and cause.
      Parameters:
      msg - the error message for this exception
      cause - the cause of the exception (typically another exception)
    • ServletException

      public ServletException(Throwable cause)
      Constructor given a cause.
      Parameters:
      cause - the cause of the exception (typically another exception)