In JSP, exception is an implicit object of type java.lang.Throwable class. This object can be used to print the exception. But it can only be used in error pages.It is better to learn it after page directive. Let’s see a simple example:

Example of exception implicit object:

error.jsp

<%@ page isErrorPage="true" %>  
  
  
  
Sorry following exception occured:<%= exception %>  
  
  
  

To get the full example, click here full example of exception handling in jsp. But, it will be better to learn it after the JSP Directives.