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.
> 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.
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:
> 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) > > 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.
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.blazejew...@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,
> > 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) > > > 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.
> 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
> 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