I was reading the Manning's SCWCD Study Kit , and particularly confused on the NOTE regarding error handling on page 103 :
"if an error handler is invoked as a result of either the setStatus() or the sendError() method, javax.servlet.error.exception and javax.servlet.error.exception_type are set to null. Similarly, if an error handler is invoked as a result of an exception, javax.servlet.error.code is set to null"
when I wrote a test program that throws an exception , I was able to retrieve BOTH error code and exception type. Here's the output :