Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value="/getTestEntity", method=RequestMethod.GET)
- public @ResponseBody TestEntity test(){
- TestEntity e = new TestEntity();
- e.setId(3);
- e.setText("3");
- return e;
- }
- @RequestMapping(
- value="/postTestEntity",
- method=RequestMethod.POST, produces=MediaType.APPLICATION_JSON_VALUE,
- consumes=MediaType.APPLICATION_JSON_VALUE)
- public @ResponseBody TestEntity test2(@RequestBody TestEntity ent){
- System.out.println(ent);
- return ent;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement