On Saturday, December 11, 2010 2:01:28 PM UTC-8, zixzigma wrote: > > is it possible to use 2.1.1 RequestFactory/AutoBean to convert POJO to > JSON and viceversa > when interacting with a RESTful Web Service ? > > the common practice with GWT client-server communication is > to have packages: > client, shared, server, configuring web.xml > > however, in-order to be truly loosely coupled, > I am thinking of developing the Server side of my app, > as a REST WebService. completely separate from the client. > sending JSON encoded data to the Server, and reading JSON. > > only using a common .jar file on both containing Entity POJOs. > > the problem on GWT client side is a clean way of Converting JSON to > POJO back and forth. > > I was wondering if the new AutoBean/RequestFactory/EntityProxy can > help in the situation I described ? >
Clean conversion of JSON is achieved with com.google.gwt.jsonp.client.JsonpRequestBuilder Request factory is not necessary. These guidelines describe the basics of working with JSON and overlay types (JavaScript objects wrapped with Java facade) http://code.google.com/webtoolkit/doc/latest/tutorial/JSON.html com.google.gwt.jsonp.client.JsonpRequestBuilder simplifies things even more because there is no need to do any JSNI and eval(). And it also allows for cross-site communication variant called JSON with padding, which is described in detail here: http://code.google.com/webtoolkit/doc/latest/tutorial/Xsite.html > Can i still use "Editor" if I opt for JSON/REST solution above ? > What do you think of this approach ? do you think it may result in > performance problems ? > > Since overlay types look like POJOs, I think they should work with Editor framework, but I haven't tried that. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.