Master java skills

exception Implicit Object

exception is the implicit object of Throwable class. This implicit object is used for exception handling in jsp pages.

Note -> exception implicit object can only be used in error pages.

To handle exception in jsp pages, two attributes of page directives is used: isErrorPage, errorPage

There is another way of handling exceptions in jsp pages. That is by using <error-page> element in web.xml file.

To understand about exception implicit object in more detail, we need to learn about Directive elements. Below is a glimplse of how exception is used in jsp page. To understand the full example, we will do so in coming chapters.

<html>
  <body>
    <% int[] intArr = {1,2,3,4,5};
      out.println(num1[6]);
    %>
    Exception Occured : <%= exception %>
  </body>
</html>