This J2EE program demonstrates a method of handling status code errors in web.xml (Tested in weblogic 7.0). This is important since normal users are not familier with statuscode it. Therefore, the servlet can use the status codes to indicate the status of the response. This method does not trigger the container to generate an error page. It just sends the status code to the browser.
Here is the web.xml for the servlet developer can specify this code anywhere in where in web.xml but should be outside servlet & servlet-mapping tags.
<error-page> <error-code> 411 </error-code> <location>/error.jsp </location> </error-page>