I have setcat tomcat to catch all my exceptions and pass them to the servlet with the following in web.xml.
<servlet-mapping> <servlet-name>exception</servlet-name> <url-pattern>/exception</url-pattern> </servlet-mapping> <error-page> <exception-type>java.lang.Exception</exception-type> <location>/exception</location> </error-page>
This works fine, and I have a servlet logging some information and forwarding to jsp. However, I want to register the URI that caused the exception to be thrown, and when I call request.getRequestURI (), I get / exception, which is my servlet path that handles the exception. How can I get the source URI that caused the exception?
source share