To use this, simply import the zip file into eclipse: (File->Import, select Existing Projects into Workspace).

Once it is imported, you should have 3 projects in your eclipse workspace:
The GWT project is simply the GWT jars wrapped in a bundle.
The client project is the client side code, and the server project is the servlet we use (it simply returns the word "World" to complete Hello, World.)

I have included an external tool to compile the client side code. Make sure you select com.example.gwtclient ant_build.xml in the external tools list.

After this runs, you should refresh your workspace (press F5). Under the com.example.gwtclient you should have www directory.
Finally, you can use the provided launch configuration to actually launch OSGi, the Jetty engine and the servlets. To do this, go to Run Configurations..., and select GWT Example Launch.

This will launch the Jetty server on port 80. If you want to change this, go to the Arguments tab and set -Dorg.osgi.service.http.port=8080 in the VM arguments.
Once running, simply hit: http://localhost/index.html

If anyone is interested, we could extend this and make it part of the Eclipse Examples project. However, there may be some licensing issues as it currently includes the GWT jars.
8 comments:
Ian,
It's always extremely useful to have a working example as a basis for starting out. The jars have Apache License, so that should be fine.
Very cool! Thanks.
Ed, to do this would I have to propose a GWT bundle for Orbit?
Unfortunately the link containing the project zip doesn't work!
would youlz send the zip file to this adress : (anouar.khemili@gmail.com)
thank you!
Could one truly have plugins this way that work on the client-side too? The main problem I see is that a plugin could not hand a class to the framework, because in client-side GWT, new instances can only be created directly from class literals (i.e., statically).
Great!! The link is working now.
Tkanks
ian,
I get a ClassCastException from SimpleServiceImpl when the server is called, what could be the reason?
PD: I quit "Require-Bundle: javax.servlet" from com.google.gwt MANIFEST to avoid nasty classloader, since gwt-user.jar contains the package.
Post a Comment