title: Issue with spring error-page and web.xml
body: <p>here is my web.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><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>Below is my Controller class :
  </p>
  
  <pre><code>import org.springframework.stereotype.Controller;
  import org.springframework.ui.ModelMap;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.servlet.ModelAndView;
  import javax.servlet.http.HttpServletRequest;
  
  
  @RequestMapping(value = "/error")
  @Controller
  public class ErrorController {
  
  @RequestMapping(value = {"/307", "/400", "/401", "/403", "/404", "/405", "500", "503"})
  public ModelAndView error(HttpServletRequest request) throws Exception {
      String path = request.getServletPath().replace("/error/", "");
      return new ModelAndView("redirect:/error/view/"+path);
  }
  </code></pre>
  
  <p>if I request error url like this</p>
  
  <pre><code>http://localhost:8080/erro/
  </code></pre>
  
  <p>it display 404 error-page but it change url </p>
  
  <pre><code>http://localhost:8080/error/view/404
  </code></pre>
  
  <p>If invalid URL is requested, the error page appears but old url has changed. What do I need to fix so that old url does not change and only the error page appears?</p>
  
  <p>thanks :)</p>