I am happy to report that I finally got exception handling to work using the
web.xml approach.  To me this approach makes the most sense for handling
errors.  (Forwarding is a different issue.)  It was a patchwork of
assistance from many that finally led me to this point.  Thanks to all who
contributed.

I also want to report exactly what the hangup was because it illustrates how
newbies like myself can easily miss important points.

The solution is very obvious once the problem is understood.  The thing is
that the web.xml approach is an exception catcher.  It is an alternative to
try/catch blocks.  For web.xml to catch an exception, the exception has to
actually be thrown and not caught by some other means such as a catch
block.  In the situation under study the exception that I was dealing with
was logged but caught in a catch block.  Therefore, web.xml never saw the
exception.  The solution was simply to remove the try/catch blocks and
substitute a throws statement.  Once I did that, web.xml began catching the
exceptions just fine.  It's all just a case of understanding.  In that
regard I want to report that I have taken Mark's suggestion and ordered a
new book dealing with servlets and JSP (expedited shipping).  I should have
it in a few days.  I recognize that I need some major help that goes beyond
what a list can provide.  I do, however, sincerely appreciate all the help
that I have received on this list.

Finally, as I have said, I now have the error handling working.  My errors
page displays the information obtained from exception.toString().  Is there
any other information available that I could display on my errors page?

Thanks.

          ... doug

Reply via email to