2
votes

I'm working with a project where I use GWT. There's no problems with it, but now I need my code elsewhere. In fact I need to copy my GWT-RPC methods to another (non-GWT) project.

I think I have 2 options:

1) Create jar which contains shared code and refer to that from GWT (and other) project. Problem is that shared code contains some classes which are needed on GWT client side. As far as I know GWT doesn't support that (client-classes coming from jar).

2) Keep GWT project as it is and use Eclipse's export tool to make jar-file which contains shared classes. Problem is that GWT client classes implements com.google.gwt.user.client.rpc.IsSerializable, but that can be solved by making dummy interface with that name.

Any comments?

When I wrote this I got an idea to call directly GWT-RPC somehow from non-GWT project...would it be possible?

2

2 Answers

4
votes

GWT does support client classes coming from jar files. Only requirement is that the jar file should contain the java source files as well. For examples standard gwt classes are in a jar gwt-user.jar.

Hope this helps.

1
votes

You just create another project and call GWT RPC objects just like that. It will work trust me. I've done that.