title: Getting an URL which led to error (404) from error-page controller in spring MVC
body: <p>Say, i have a Spring MVC application with the following web.xml entry:</p>
  
  <pre><code>&lt;error-page&gt;
      &lt;error-code&gt;404&lt;/error-code&gt;
      &lt;location&gt;/error/404&lt;/location&gt;
  &lt;/error-page&gt;
  </code></pre>
  
  <p>and following error-page controller:</p>
  
  <pre><code>@RequestMapping({"","/"})
  @Controller
  public class RootController {
  
      @RequestMapping("error/{errorId}")
      public String errorPage(@PathVariable Integer errorId, Model model) {
          model.addAttribute("errorId",errorId);
  
          return "root/error.tile";
      }
  }
  </code></pre>
  
  <p>Now user requested non-existent URL /user/show/iamnotauser which triggered error page controller. How do i get this non-existent '/user/show/iamnotauser' URL from errorPage() method of RootController to put it into model and display on error page ?</p>