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