- java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64
添加依赖
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
- json格式转换
对于形如 String aaa = {bookId=2012, bookInfoId=785} 等于号的格式转json
//采用 fastjson
Object json = JSON.toJSONString(aaa);
//采用gson
Gson gson = new Gson();
Object json = gson.toJson(aaa);