title: Request Forward to another url in spring boot mvc with mustache template
body: <p>I am trying to forward the request to another url in spring boot.</p>
  
  <p>I know how to forward the request from one endpoint to another endpoint in the same spring boot application. The code for this is like - </p>
  
  <pre><code>@GetMapping("/home")
  public ModelAndView home(@PathVariable(name = "env", required = false) String env) {
  
      return new ModelAndView("index");
  }
  @GetMapping("/forward")
  String callForward(){
      return "forward:/home";
  }
  </code></pre>
  
  <p>Here If I go to <a href="http://localhost:8080/forward" rel="nofollow noreferrer">http://localhost:8080/forward</a> then it will be server by "/home" endpoint and we'll get the home page rendered. Interesting thing here is "url" in the browser remains same <a href="http://localhost:8080/forward" rel="nofollow noreferrer">http://localhost:8080/forward</a>.</p>
  
  <p>My requirement is > I want to forward to the request to any third party url for example when <a href="http://localhost:8080/forward" rel="nofollow noreferrer">http://localhost:8080/forward</a> is called I want it to be served by <a href="https://google.com/forward" rel="nofollow noreferrer">https://google.com/forward</a>.</p>
  
  <p>How can I do it.</p>
  
  <p>I am open to any solution which can fulfill the requirement.</p>