title: Spring MVC - @RequestMapping GET and POST @RequestMethod
body: <p>I understand this question has been asked previously, I am learning <strong>Spring</strong> following along <strong>Spring Petclinic Sample project</strong>. There is no problem with <strong>processCreationForm</strong>, when a redirect is done to <strong>showOwner</strong> using <strong>GET</strong> it works as expected, but when I experiment it by using <strong>POST</strong> it throws <strong>HTTP Status 405 - Request method 'GET' not supported</strong>. Is it because <strong>processCreationForm</strong> is doing a redirect to <strong>showOwner</strong> I am unable to grab it as POST request?</p>
  
  <pre><code>@RequestMapping(value = "/owners/new", method = RequestMethod.POST)
  public String processCreationForm(@Valid Owner owner,
              BindingResult result) {
      if(result.hasErrors()) {
          return "owners/ownerForm";
      } else {
          this.clinicService.saveOwner(owner);
          return "redirect:/owners/" + owner.getId();
      }
  }
  
  @RequestMapping(value = "/owners/{ownerId}", method = RequestMethod.POST)
  public ModelAndView showOwner(@PathVariable("ownerId") int ownerId) {
      ModelAndView mav = new ModelAndView("owners/ownerDetails");
      mav.addObject(this.clinicService.findOwnerById(ownerId));
      return mav;
  }
  </code></pre>
  
  <p>Any helpful comments are appreciated.</p>