반응형
String data 를 Json object 로 변환하기.
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;
String jsonData = "{a:1, b:2 ....}";
JSONObject jsonObject = JSONObject.fromObject(JSONSerializer.toJSON(jsonData));
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;
String jsonData = "{a:1, b:2 ....}";
JSONObject jsonObject = JSONObject.fromObject(JSONSerializer.toJSON(jsonData));
반응형
'프로그래밍 > Java' 카테고리의 다른 글
reflection을 이용한 오브젝트의 함수 실행. (1) | 2011.09.20 |
---|---|
[spring] static 변수에 autowired 설정하기. (0) | 2011.09.20 |
http request post data 읽기. (0) | 2011.09.19 |
Redirect VS Forward (0) | 2011.08.31 |
[Spring3] applicationContext.xml 설정 시 에러. (0) | 2011.07.25 |