Getting json by DWR (Direct Web Remoting)
问题 I want to know how can I convert a Java object to JSON by using DWR. I have already tried JsonUtil.toJson(myObject) , but it gives a NullPointerException at org.directwebremoting.json.JsonUtil.toJson(JsonUtil.java:127) . Can anyone tell me any way of converting the Java Object to JSON? I would prefer achieving it by DWR. 回答1: Why not use the JSON library itself? JSON Or even the Google-Gson Library GSON Also, for further reference, use the Search, since similar questions to this one have been