Best practice to serialize a org.w3c.dom.Document over RPC?
331 views
Skip to first unread message
Richard Kennard
unread,
Jul 5, 2010, 3:02:53 AM7/5/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
Hi guys,
A (hopefully easy) question: what is the GWT 'best practice' to take a
server-side DOM built with org.w3c.dom.Document and pass it over RPC?
Clearly once on the client-side it needs to become a
com.google.gwt.xml.client.Document, and I can achieve this by
serializing to and from a String of XML, but is there a better way?
Something more performant that uses some built-in DOM serialization
capabilities?
Regards,
Richard.
Thomas Broyer
unread,
Jul 5, 2010, 4:30:42 AM7/5/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
I doubt there would be anything more performant than XML
serialization. Particularly on the client-side, as this is done by the
browser, and not by some JavaScript code.
Harald Pehl
unread,
Jul 5, 2010, 5:10:40 AM7/5/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I agree with Thomas. XMLParser.parse(xmlString) uses the browsers xml
parser which should be reasonable fast.
If you want to further process the XML document (e.g. map it to POJOs)
feel free to take a look at Piriti: http://code.google.com/p/piriti/.
It's a little lib I wrote to map XML / JSON to POJOs using annotations
and deferred binding.
- Harald
Richard Kennard
unread,
Jul 5, 2010, 6:29:59 PM7/5/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
Perfect! Thanks for the detailed and fast responses guys.