I am new to GWT. Here is what I want to do.
I have my Domain Objects which have to be passed to GWT Server layer
to get rendered in UI.
Instead of passing the Domain Objects as Java objects I have decided
to convert the Domain Objects to JSON objects and pass it to the GWT
Server Layer.
My questions are as follows:
(1) Is there any out of box Pojo to JSON converter that I can use,
preferably provided by GWT.
(2) I am not interested in using JSON_RPC I just need JSON to as as
data transfer object between my Domain layer and GWT Server layer. Can
I do this.
(3) Are there any examples that provide my a sample to the above
approach. The example provided in GWT dist package is using JSON to
communicating to other server I guess. I need a simple example which
will use JSON instead of a Java Object to display the content on the
browser.
Also provide comments on the approach I am taking.
TIA,
Naseer.
#1
http://xstream.codehaus.org/
it is used e.g. in Grails framework to provide JSON converter
#2
there is no JSON_RPC in default tookit api, Simply use plain HTTP
rquest (e.g. restfull) and convert results to JSON object
#3
rocket-gwt library has json serializer:
http://code.google.com/p/rocket-gwt/wiki/JsonSerialization
#4
you can use JavaScript interop project to bind JSON object to Beans on
client side:
http://code.google.com/p/gwt-api-interop/
regards,
Peter
On Oct 5, 4:08 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:
> hi Nasser,
>
> #1http://xstream.codehaus.org/