title: How to redirect properly in RESTful Spring MVC controller
body: <p>When I'm trying to send PUT request to the handler of my controller all works fine</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.PUT,
                  consumes = "application/json",
                  headers = "content-type=application/json")
  public String updateCompany(@RequestBody Company company) {
      companyRepository.updateCompany(company);
      return "redirect:/api/company/" + company.getId();
  }
  </code></pre>
  
  <p>But when it redirect to another handler</p>
  
  <pre><code>@RequestMapping(value = "/{id}", method = GET,
                  produces = "application/json")
  public @ResponseBody Company getCompany(@PathVariable("id") Integer id) {
      Company c = companyRepository.getCompany(id);
      return new CompanyToJsonWrapper(c);
  }
  </code></pre>
  
  <p>I'm getting <code>HTTP Status 405 - Request method 'PUT' not supported</code> error. Any ideas how to fix it?</p>