Skip to content

Instantly share code, notes, and snippets.

@horte
Created March 2, 2012 18:32
Show Gist options
  • Save horte/1960241 to your computer and use it in GitHub Desktop.
Save horte/1960241 to your computer and use it in GitHub Desktop.
Spring @RequestBody
@RequestMapping(value = "/objects/", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.CREATED)
@ResponseBody
public SomeObj createObject(@RequestBody SomeObj obj) {
//Do your things
return obj;
}
//My Object which should be deserialized
public class SomeObj {
private Long id;
private String name;
private Date date;
private List<Integer> list;
private User user;
private MyObj myObj;
....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment