title: Using a String variable in RequestMapping value
body: <p>I have the following:</p>
  <pre><code>@Value(&quot;${apiVersion&quot;)
  private String apiVersion;
  
  @RequestMapping(value = &quot;/{apiVersion}/service/call&quot;, method = RequestMethod.POST)
  </code></pre>
  <p>And I expected the URL to be:</p>
  <pre><code>/apiVersion/service/call
  </code></pre>
  <p>But it turns out <code>{foo}</code> accept any value, it doesn't actually use the String.</p>
  <p>Is there a way for me to use the String value as part of the URL?</p>
  <p><strong>EDIT</strong></p>
  <p>The issue is that I have multiple calls that us that value.</p>
  <pre><code>@RequestMapping(value = apiVersion + &quot;/call1&quot;, method = RequestMethod.POST)
  
  @RequestMapping(value = apiVersion + &quot;/call2&quot;, method = RequestMethod.POST)
  
  @RequestMapping(value = apiVersion + &quot;/call3&quot;, method = RequestMethod.POST)
  
  etc.
  </code></pre>
  <p>Technically I can declare constants for each one like you suggested, but it doesn't sound optimal. If there is no way to do it then it is fine, I was just wondering if there is.</p>
  <p><strong>SOLUTION</strong></p>
  <p>Adding general mapping to the controller.</p>
  <pre><code>@RequestMapping(&quot;${apiVersion}&quot;)
  </code></pre>