title: catch 404 error spring boot to return custom html
body: <p>How can i catch 404 error in application and render a custom html like index.html? i don't want to use a page inside the /error folder.</p>
  
  <p>for example if i'm asking for <a href="http://localhost:8080/test" rel="nofollow noreferrer">http://localhost:8080/test</a> and there is no mapping for test, my application should render index.html inside the /resources/template folder</p>
  
  <p>Thanks</p>
  
  <p>****EDIT****</p>
  
  <p>kinda solved this way, the bad thing is that i can't change the path for request mapping even changing the getErrorPath return value.</p>
  
  <pre><code>@Controller
  public class MyCustomErrorController implements ErrorController {
  
      @RequestMapping("/error")
      public String handleError() {
          return "globalerrorview";
      }
  
      @Override
      public String getErrorPath() {
          return "/error";
      }
  }
  </code></pre>