'JSONParser'에 해당되는 글 1건

  1. 2016.03.10 jsp json spring array
카테고리 없음2016. 3. 10. 10:54
반응형

-------------------------- pom.xml

1
2
3
4
5
<dependency>            
    <groupId>com.googlecode.json-simple</groupId>            
    <artifactId>json-simple</artifactId>            
    <version>1.1.1</version>        
</dependency>
cs

-------------------------- ***controller.java

1
@RequestBody String jsonData
cs


-------------------------- ***ServiceImpl.java

1
2
3
JSONParser jsonParser = new JSONParser();            
JSONObject jsonObject = (JSONObject) jsonParser.parse(paramMap.get("jsonData").toString());            
JSONArray jsonArray = (JSONArray) jsonObject.get("models");
cs



Posted by 1010