본문 바로가기
Frontend/JSON

@RequestBody

by 지구 2018. 5. 11.

@RequestBody

codehaus가 JSON객체를 Domain Object로 Binding시켜줌


1
2
3
4
5
6
7
8
@RequestMapping(value="json/getUser/{value}", method=RequestMethod.POST)
public Map getUser(@PathVariable String value, @RequestBody User user) throws Exception{
    Map map = new HashMap();
    map.put("user",user);
    System.out.println(user);
 
    return map;
}
cs


반응형

'Frontend > JSON' 카테고리의 다른 글

JSON 과 String 의 그 사이..  (0) 2018.05.17
ObjectMapper, JSONObject  (0) 2018.05.11
JSON 기본 정리  (0) 2018.05.10

댓글