The Java EE 6 Tutorial

ProcedureTo Set Up Error Mapping Using NetBeans IDE

  1. Open the project if you haven’t already.

  2. Expand the project’s node in the Projects pane.

  3. Expand the Web Pages node and then the WEB-INF node.

  4. Double-click web.xml.

  5. Click Pages at the top of the editor pane.

  6. Expand the Error Pages node.

  7. Click Add.

    The Add Error Page dialog opens.

  8. Click Browse to locate the page that you want to act as the error page.

  9. In the Error Code field, type the HTTP status code that will cause the error page to be opened.

  10. In the Exception Type field, type the exception that will cause the error page to load.

  11. Click OK.