title: Spring Framework, enable PUT method
body: <p>I got a problem with capturing PUT request sent to server. </p>
  
  <p>These are my methods:  </p>
  
  <pre><code>@RequestMapping(method= RequestMethod.GET)  
  public String getCity(@PathVariable(value="cid") String cid, @RequestParam(value="State") Integer state,  Model model) {
      System.out.println("get request");  
      return "index";  
  }
  
  
  @RequestMapping(method= RequestMethod.PUT)  
  public String putCity(@PathVariable(value="cid") String cid, @RequestParam(value="State") Integer state, Model model) {
      System.out.println("put request");
      return "index";
  }
  </code></pre>
  
  <p>When I traced the call, my PUT request was handled by GET method and not by PUT method in my class.. on out screen, it always read as "get request". I've checked the browser log and confirms that they sent the correct PUT request, so I think I've missed some Spring configuration here, but I don't know what  it is..</p>
  
  <p>Can someone please help?</p>
  
  <p>Thank you.</p>
  
  <p>EDIT: Additional code with class:</p>
  
  <pre><code>@Controller
  @RequestMapping(value="/retail/{cid}/master/city")
  public class City {
  
      @RequestMapping(value="/foo1", method= RequestMethod.GET)  
      public String getCity(@PathVariable(value="cid") String cid, @RequestParam(value="State")   Integer state,  Model model) {
          System.out.println("get request");  
          return "index";  
      }
  
      @RequestMapping(value="/foo2", method= RequestMethod.PUT)  
      public String putCity(@PathVariable(value="cid") String cid, @RequestParam(value="State") Integer state, Model model) {
          System.out.println("put request");
          return "index";
      }
  }
  </code></pre>
  
  <p>EDIT2:
  Sorry, it seems I didn't very thorough when examining the log.. I caught this warning twice.</p>
  
  <pre>WARNING: Error in annotation processing: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor</pre>
  
  <p>any ideas how to fix that? </p>