How to use RPC serialization with in HTML page?

3 views
Skip to first unread message

Rohit Ghatol

unread,
Nov 14, 2007, 7:19:30 AM11/14/07
to Google Web Toolkit
Hi,
My question will sound simple when you read through the scenario
below-

The scenario is targeted towards JSP based application using GWT. What
I wish to do is convert a Java bean (1.4 compatible and serailizable)
into json representation using RPC serialization and write it in JSP
page inside a div with id "data".
In my GWT client side code, I would read the contents of div with id
"data" and deserialize the JSON representation to java object.

The reason I want to do this is my GWT application only requires data
at load time, and I do not want it to go and fetch it from server
using RPC service request, as this would involve 1. loading of page 2.
RPC request and async response.

How do I go about doing this? I want to use this as a standard in many
of my GWT applications which need a java bean as its initial data.

regards,
Rohit

Peter Blazejewicz

unread,
Nov 14, 2007, 7:39:40 AM11/14/07
to Google Web Toolkit
hi,
please use "search" feature, it works,
e.g. today thread:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/784f339560ac2f7e#
linking to few days back thread,
regards,
Peter

Peter Blazejewicz

unread,
Nov 14, 2007, 7:42:14 AM11/14/07
to Google Web Toolkit
also:
including your data as plain text within divs is not recommended,
include it as javascript code (it will be evaluated by browser),
this will expose you more solutions how to work with such data,

regards,
Peter

On Nov 14, 1:39 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:


> hi,
> please use "search" feature, it works,

> e.g. today thread:http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...

Miguel Méndez

unread,
Nov 14, 2007, 12:18:29 PM11/14/07
to Google-We...@googlegroups.com
In the 1.5 release we are adding a SerializationStreamFactory interface to the client side RPC proxy.  This will allow you to get a SerializationStreamReader which will be able to deserialize the pre-recorded RPC response.

On Nov 14, 2007 7:42 AM, Peter Blazejewicz <peter.bl...@gmail.com> wrote:

also:
including your data as plain text within divs is not recommended,
include it as javascript code (it will be evaluated by browser),
this will expose you more solutions how to work with such data,

regards,
Peter

On Nov 14, 1:39 pm, Peter Blazejewicz <peter.blazejew...@gmail.com>
wrote:
> hi,
> please use "search" feature, it works,
> e.g. today thread:http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
> linking to few days back thread,
> regards,
> Peter
>
> On Nov 14, 1:19 pm, Rohit Ghatol <rohitsgha...@gmail.com> wrote:
>
> > Hi,
> > My question will sound simple when you read through the scenario
> > below-
>
> > The scenario is targeted towards JSP based application using GWT. What
> > I wish to do is convert a Java bean ( 1.4 compatible and serailizable)

Peter Blazejewicz

unread,
Nov 14, 2007, 5:55:23 PM11/14/07
to Google Web Toolkit
hi Miguel,

> In the 1.5 release we are adding a SerializationStreamFactory interface to
> the client side RPC proxy. This will allow you to get a
> SerializationStreamReader which will be able to deserialize the pre-recorded
> RPC response.
that's sounds really, really good! thanks for listening :D

regards,
Peter

Miguel Méndez

unread,
Nov 15, 2007, 9:27:38 AM11/15/07
to Google-We...@googlegroups.com
np
Reply all
Reply to author
Forward
0 new messages