Created
March 2, 2012 18:32
-
-
Save horte/1960241 to your computer and use it in GitHub Desktop.
Spring @RequestBody
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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