On May 9, 2010, at 9:48 AM, Dale Newfield wrote: > On 5/9/10 9:57 AM, mlounnaci wrote: >> I realy need to use these two functions fromJSON() / toJSON(). Knowing >> that there is a circular reference between my objects. >> >> Can you tell me more how to use them? > > I wrote them by hand. Based on the library available from > http://www.JSON.org/java/index.html and knowledge of which of the object's > components needed to be serialized. I then sent the string representation of > the object in the service call instead of the object itself. > > You might not need to go this route, if you can figure out what is doing the > serialization, you might be able to just add xdoclet (or more likely > annotation) info to the data classes' getters/setters to instruct the > serializer/deserializer how it should behave (what it should ignore). The > first step is figuring out which tool is doing that serialization, so that > you can find the appropriate documentation. A call stack related to this > "cycle detected" error might provide the answer to that question... > > -Dale
Jackson is an excellent library for doing JSON with Java. http://jackson.codehaus.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net