zhangzijiez 2018-04-10 15:16 采纳率: 38.5%
浏览 4664
已结题

请教如何把list转换成json,不要jsonarray这种带[{}]这种的

整了还久还是没找到方法,请教各位大神了
List info = service.selInfo(string);
这样的list怎么转换json{}

这个又是什么错误呢

 严重: Servlet.service() for servlet [dispatcherServlet] in context with path [/TextGrad] threw exception [Handler processing failed; nested exception is java.lang.AbstractMethodError: Method org/apache/commons/dbcp/DelegatingResultSet.getNString(Ljava/lang/String;)Ljava/lang/String; is abstract] with root cause
java.lang.AbstractMethodError: Method org/apache/commons/dbcp/DelegatingResultSet.getNString(Ljava/lang/String;)Ljava/lang/String; is abstract
  • 写回答

3条回答 默认 最新

  • threenewbee 2018-04-10 15:48
    关注
     BillingInfo是怎么定义的?你需要什么格式的json?大不了自己拼接下
    String json = "";
    bool b = true;
    for (BillingInfo b : info)
    {
    if (!b) //不是第一行 json += 分割符; else b = false;
    json += b.xxx; //在这里拼接每一行
    }
    
    评论

报告相同问题?