posted 17 years ago
I know that there is some work in the next version of DWR to use JSON rather than (or perhaps in addition to, not sure) the custom protocol DWR uses. That might help.
Short of that, I'd suggest a decent library to convert your objects to JSON. Most of the major libraries nowadays provide that functionality. You'll of course have to ensure your object model matches up with what the widgets expect so that conerted to JSON it'll be ready to go. Alternatively, provide a json field on your returned object that is generated via a getJson() method. That way, all your object you get back from DWR will have a JSON representation of themselves. This of course means you'll have to write the code to do that conversion, but that's not too difficult, and it'll let you ensure the JSON is in the format you need,
-- <br />Frank W. Zammetti<br />Founder and Chief Software Architect<br />Omnytex Technologies<br /><a href="http://www.omnytex.com" target="_blank" rel="nofollow">http://www.omnytex.com</a><br />AIM/Yahoo: fzammetti<br />MSN: [email protected]<br />Author of "Practical Ajax Projects With Java Technology"<br /> (2006, Apress, ISBN 1-59059-695-1)<br />and "JavaScript, DOM Scripting and Ajax Projects"<br /> (2007, Apress, ISBN 1-59059-816-4)<br />Java Web Parts - <a href="http://javawebparts.sourceforge.net" target="_blank" rel="nofollow">http://javawebparts.sourceforge.net</a><br /> Supplying the wheel, so you don't have to reinvent it!