I would like to use GWT as an alternative frontend for a Java EE 6 application. What is the best practice architectural approach?
I've worked through the GWT tutorial from Google (StockWatcher) but I am wondering how to 'exchange' the GWT backend for a Java EE 6 backend.
GWT runs (as JavaScript) in a browser, so it communicates with a web server simply by using HTTP requests. If you choose Servlets (RemoteServiceServlets for GWT-RPC) to respond to these requests, you can use any servlet container to host the Servlets.
In development mode, you can use the -noserver option to use your own server instead of the built-in Jetty.
You can call ejbs from RPC servlets. I prefer not to user -noserver. Instead we are using JEE6 EJB's deployed on Glassfish 3.1 for development (you can deploy standalone EJB, outside EAR on 3.1 - you can't do that on 3.0). Development mode works fine with remote interfaces if you add gf-client.jar to the classpath. You can also create ServiceLocator that will use remote interfaces while in development mode, and local while invoked from war deployed in the same ear as ejb.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With