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.