Hello,

I'm asking you " What do mean by generating POJO at server?"

what I am assuming is it's not a dynamic POJO generation I mean at runtime,
If this is the your answer, Yes it is not possible to pass POJO objects
through GWT RPC mechanism, because you know, GWT RPC generates some
serialization policies based on the POJO types.

If your POJO generation is static, Yes you can pass them through GWT RPC as
shown in the below examples.

*Example-1:* Say you have generated "ViewModelPOJO" and put under a shared
package, which means that both client and server code can use the POJO.

the basic idea here is you should share the source code of your POJO's with
the GWT client code for GWT compiler to generate the equivalent Java Script
code.

[image: Inline image 1]
*
*
*Client ------------ .JS*
*Server-----------.CLASS*
*Shared---------.CLASS + .JS*

*Example-2:* say you have generated the View POJO in a separate project.
what you should do is add .gwt.xml file in your project as shown below.
[image: Inline image 2]

generate a source jar for the above project and put it in classpath of your
GWT project  and inherit the samplePOJO gwt module in Sample.gwt.xml GWT
module (as shown in example1)  and you can use them both in the client and
server, I mean you can pass them back and forth (client-server).

I think this clarifies your question.

Regards,
Saida.

On Thu, Mar 1, 2012 at 2:09 PM, Domenico <domenico.scarmozz...@gmail.com>wrote:

> Hi, thanks both for the answers. OK maybe use the POJOs in client code
> will not be a good idea, but my idea was to generate POJOs on the
> server side and passing to the GWT client through RPC. Do you think it
> is feasible ?
>
> On Feb 29, 9:42 am, saida dhanavath <dhana....@gmail.com> wrote:
> > Hi,
> >
> > As long as you provide the required source code for the generated POJO's
> to
> > GWT compiler for generating the JavaScript it will work.
> >
> > But, I think when you generate POJO's using XMLBeans, your POJO's will
> have
> > some dependency on XMLBeans (Data Binding) annotations and GWT compiler
> > forces you to provide the source code of XMLBeans, I don't think it's a
> > good idea use generated POJO's in GWT client code.
> >
> > we also had very similar requirement, and we went on having separate view
> > beans for GWT client.
> >
> > I hope this helps you!
> >
> > Regards,
> > Saida.
> >
> > On Tue, Feb 28, 2012 at 2:19 PM, Domenico <
> domenico.scarmozz...@gmail.com>wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > Hi,
> > > I'm trying to simplify the stack of a web application (based on J2EE)
> > > that takes an XML profile from backend convert it in a POJO (with some
> > > XML data binding tool) and then throughout several data
> > > transformations it becomes a view bean and then presented in
> > > JavaScript. The idea is to simplify this stack using XMLBeans to
> > > generate automatically the POJO and using directly this POJO in the
> > > GWT application (without any intermediate transformation). Do you
> > > think is it possible to use this strategy, in particular using a
> > > normal POJO in the GWT application?
> >
> > > Thanks a lot for your help
> >
> > > --
> > > 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.
> >
> > --
> > Regards,
> > Saida Dhanavath
>
> --
> 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.
>
>


-- 
Regards,
Saida Dhanavath

-- 
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.

<<image.png>>

<<image.png>>

Reply via email to