title: REST web service versioning in practice
body: <p>I am creating a new web service and I have read some of the ebooks from APIgee where versioning the web service is a recommended. I understand there is some "battle" between keeping versioning info in the URL vs. the header. From what I have read and understand I want to use versioning in the header.</p>
  
  <p>My question is; how does this looks like in practice? I am using Spring MVC 3.2. Do you just create a methods like this in the same controller which responds to different versions?</p>
  
  <p>Version 1:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, produces = "application/vnd.example-v1+json")
  </code></pre>
  
  <p>Version 2:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, produces = "application/vnd.example-v2+json")
  </code></pre>
  
  <p>Or is this wrong? Or is it more usual to create different packages that holds different versions of the controller? Or are there other ways?</p>