title: How to get request URL in Spring Boot RestController
body: <p>I am trying to get the request URL in a RestController. The RestController has multiple methods annotated with <code>@RequestMapping</code> for different URIs and I am wondering how I can get the absolute URL from the <code>@RequestMapping</code> annotations.</p>
  
  <pre><code>@RestController
  @RequestMapping(value = "/my/absolute/url/{urlid}/tests"
  public class Test {
     @ResponseBody
     @RequestMapping(value "/",produces = "application/json")
     public String getURLValue(){
        //get URL value here which should be in this case, for instance if urlid      
         //is 1 in request then  "/my/absolute/url/1/tests"
        String test = getURL ?
        return test;
     }
  } 
  </code></pre>