Advertisement
Guest User

Untitled

a guest
Sep 18th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. @RequestMapping(value="/getTestEntity", method=RequestMethod.GET)
  2.     public @ResponseBody TestEntity test(){
  3.         TestEntity e = new TestEntity();
  4.         e.setId(3);
  5.         e.setText("3");
  6.         return e;
  7.     }
  8. @RequestMapping(
  9.     value="/postTestEntity",
  10.     method=RequestMethod.POST, produces=MediaType.APPLICATION_JSON_VALUE,
  11.     consumes=MediaType.APPLICATION_JSON_VALUE)
  12.     public @ResponseBody TestEntity test2(@RequestBody TestEntity ent){
  13.         System.out.println(ent);
  14.         return ent;
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement