Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Using Spring with GWT and J2S

Using Spring with GWT and J2S

Google Web Toolkit and Java2Script Pacemaker (J2S) are two Java to JavaScript compilers that enable rich internet applications to be written in Java with JavaScript generated. Recent articles describe how to integrate these tools with Spring.

Gabi S. has written a recent article describing the integration of Spring with GWT. She walks through the steps in a tutorial.

To integrate this with Spring we only have to register our GWT servlet in our web.xml so we can simply use Spring’s ServletForwardingController  to call services by name. We also have to modify a bit our GWT client to reflect a path change we have to do. We add to the web.xml file the Spring’s DispatcherServlet mappings

Her article is a more thorough example of the one posted last year by George Georgovassilis.  His article covers creating a simple calculator application that deploys as a GWT application communicating with Spring via rcp.

The GWT Widget Library contains the GWTSpringController, an abstract Spring Controller which assumes the entire GWT-RPC functionality from within the Spring environment, allowing you to harness the full range of Spring services available to its controllers, such as proxying certain method invocations with database transactions or providing context beans to your service.

Another JavaScript compiler that integrates with Spring was recently covered by InfoQ.

Rate this Article