InfoCenter Home > 4.2.1.3.5: Enhancing servlet error reportingA servlet can report errors by:
The enhanced servlet error reporting function in IBM WebSphere Application Server provides an easier way to implement error reporting. The error page (a JSP file or servlet) is configured for the application and used by all of the servlets in that application. The new mechanism handles caught and uncaught errors. To return the error page to the client, the servlet engine:
For the Application Server, the ServletResponse.sendError() method has been overriden to provide the functionality previously described. The overriden method is shown below: public void sendError(int statusCode, String message){ ServletException e = new ServletErrorReport(statusCode, message); request.setAttribute(ServletErrorReport.ATTRIBUTE_NAME, e); servletContext.getRequestDispatcher(getErrorPath()).forward(request, response); }
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|