Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 0.73 KB  |  hits: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Spring MVC:Request method 'GET' not supported,DefaultHandlerExceptionResolver handleHttpRequestMethodNotSupported
  2. @Controller
  3. public class TestResponse {
  4.  
  5.  
  6. @RequestMapping(method=RequestMethod.GET, value="/test/emp/1",
  7.         headers="Accept=application/json")
  8. public @ResponseBody Employee getEmp() {
  9. Employee e = new Employee("ad", "asdad");
  10. System.out.println("Hello World");
  11. return e;
  12. }  
  13. }
  14.        
  15. @Controller
  16.     @RequestMapping("/test")
  17.     public class TestResponse {
  18.  
  19.  
  20.     @RequestMapping(method=RequestMethod.GET, value="/emp/1",
  21.             headers="Accept=application/json")
  22.     public @ResponseBody Employee getEmp() {
  23.     Employee e = new Employee("ad", "asdad");
  24.     System.out.println("Hello World");
  25.     return e;
  26.     }  
  27. }