# Class JasperException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.apache.jasper.JasperException

All Implemented Interfaces:
  `Serializable`

public class JasperException extends ServletException
Base class for all exceptions generated by the JSP engine. Makes it convenient to catch just this at the top-level.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JasperException(String reason)`
  Creates a JasperException with the specified reason.
  `JasperException(String reason, Throwable exception)`
  Creates a JasperException with the embedded exception and the reason for throwing a JasperException.
  `JasperException(Throwable exception)`
  Creates a JasperException with the embedded exception.

- ## Method Summary

  ### Methods inherited from class ServletException

  `getRootCause`

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### JasperException

    public JasperException(String reason)
    Creates a JasperException with the specified reason.
    Parameters:
      `reason` - the exception message

  - ### JasperException

    public JasperException(String reason, Throwable exception)
    Creates a JasperException with the embedded exception and the reason for throwing a JasperException.
    Parameters:
      `reason` - The exception message
      `exception` - The root cause

  - ### JasperException

    public JasperException(Throwable exception)
    Creates a JasperException with the embedded exception.
    Parameters:
      `exception` - The root cause