9) exception implicit object

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" %>
<html>
<body>

Sorry following exception occured:<%= exception %>

</body>
</html>

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.








Latest Courses