I would like to use Tomcat's error-page directive to display various different error pages in response to various types of exceptions. However, I want the error page displayed to have different styling and content depending on the original request URL that resulted in the error.
Specifically, I have an admin part of my web application, and a user part. The error pages should be different, both in terms of styling and menus. The most reliable way to distinguish which part a given page is in is by looking for strings in the URL. I'd like to point the Tomcat error-page to, say, a servlet that would parse the URL and redirect to the appropriately styled error page.
So 1) is it possible to use error-page, or some other mechanism, to redirect errors to a servlet rather than a JSP? (And if not, can I do what I'm imagining within a JSP?)
and 2) once I'm in my servlet, can I determine the request URL that led to the error (request.requestURI doesn't appear to work -- it points to the location of the error JSP itself).