Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不知道为什么 java 没有原生的 json 解析器,很奇怪,而且我刚刚跨过不同的 jar,比如 GSON,但我对它还是比较陌生。
当我尝试system.out.println查询时:
system.out.println
System.out.println(this.db.fetchAll(query));
我得到了这样的清单
[[1, user, pass], [2, another, test], [3, argh, test]]
如何将其作为 json 发送回浏览器?
Gson gson = new Gson(); String json = gson.toJson(this.db.fetchAll(query));