title: How to get original page url/uri after request dispatcher forward
body: <p>I have a Error404Servlet which is configured as error-page for 404 in web.xml:</p>
  
  <pre><code>   &lt;servlet&gt;
        &lt;servlet-name&gt;Error404&lt;/servlet-name&gt;
        &lt;servlet-class&gt;com.foo.bar.Error404Servlet&lt;/servlet-class&gt;
     &lt;/servlet&gt;
  
     &lt;error-page&gt;
        &lt;error-code&gt;404&lt;/error-code&gt;
        &lt;location&gt;/error404&lt;/location&gt;
     &lt;/error-page&gt;
  </code></pre>
  
  <p>In this servlet i have to log the original url that caused 404, but request.getRequestURI()  always returns "/error404"</p>
  
  <p>How can i get the original url? The unly ugly method i know is to create filter that puts the original url to request attribute.</p>