Java Runtime Exceptions - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Java Runtime Exceptions

Description:

In addition to that, JSP provides a mechanism for handling runtime exceptions ... any uncaught exception is forwarded to the JSP script errorHandler.jsp ... – PowerPoint PPT presentation

Number of Views:105
Avg rating:3.0/5.0
Slides: 5
Provided by: julie387
Category:

less

Transcript and Presenter's Notes

Title: Java Runtime Exceptions


1
Java Runtime Exceptions
  • You can provide your own exception handling
    within JSP pages
  • In addition to that, JSP provides a mechanism for
    handling runtime exceptions
  • lt _at_ page isErrorPagefalse errorPageerrorHand
    ler.jsp gt
  • ? any uncaught exception is forwarded to the JSP
    script errorHandler.jsp

2
Java Runtime Exceptions
  • Inside errorHandler.jsp, we need the following
    page directive
  • lt_at_ page isErrorPagetrue gt
  • This allows the Throwable object describing the
    exception to be accessed within errorHandler.jsp
    through the implicit exception object

3
Java Runtime Exceptions
  • test.jsp
  • lt_at_ page isErrorPagefalse errorPageerrorHand
    ler.jsp gt
  • lt
  • String number 67h
  • int n Integer.parseInt( number )
  • gt

4
Java Runtime Exceptions
  • errorHandler.jsp
  • lt_at_ page isErrorPagetrue gt
  • lt
  • // use implicit object exception
  • out.println( exception.toString( ) )
  • gt
Write a Comment
User Comments (0)
About PowerShow.com