JSP exception implicit object example

In JSP, an 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.
All JSP Examples at JSP Source Code Examples.

Example of exception implicit object

Let's see a simple example:

error.jsp

%@ page isErrorPage="true" %>  
<html>  
   <body>  
  
       Sorry following exception occurred:<%= exception %>  
  
   </body>  
</html>   
All JSP Examples at JSP Source Code Examples

Comments