1. alibabajson
<dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.41</version> </dependency>
JSONUtils.toJSONString(requestMap); google
2. json-libcode
<dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.5</version> </dependency>
JSONObject jsonObject = JSONObject.fromObject(map);blog
String result = jsonObject.toString();io
3. googleast
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.3.1</version>
</dependency>
new Gson().toJson(param); class