Google Web Toolkit and Google App Engine: Java end to end

An year ago, I had written an article titled Java: No Hosting for you, where I had mentioned that most shared-hosting providers don’t allow server side Java (Java Servlets, JSP, Tomcat, EJB, J2EE). You have to use php, perl, ruby or python. Now Google has come to the rescue by adding another language to the app engine � Java. Now you can have ‘java’ on the client and java on the server. The former is made possible by GWT (Google Web Toolkit) which takes the code you write in Java and translates it into separate targeted javascript code for the 5 of the most common browsers.

Until a few days back, you could write Google App Engine apps only in Python. Rumors of Java support were swirling and it turned out to be true. Now, you have the option of using Java on the server side and run it on Google infrastructure for free. If you need to scale beyond the free quota, you only pay for what you use. Seems fair.

The 2 components GWT and App Engine are more integrated now, if you use Eclipse as your IDE. You can install Google Plugin for Eclipse, Google Web Toolkit SDK 1.6.4 and Google App Engine Java SDK 1.2.0 by adding one url site in “Software Updates and Add-ons”. After that, it took less than 5 minutes to create a skeleton gwt+AppEngine project using the wizard. Deploying the app is a one-click operation in Eclipse: Just click on the toolbar item with the picture of a Jet Engine (it’s the AppEngine’s logo or mascot). A while back, I wrote a *Math Quiz* app using GWT and deployed it on my web site. I wanted to put that app on App Engine as-is and later add some server side functionality. I had the app running in no time in the hosted mode browser. Earlier, I had to copy all the files to my server. Now all I had to do was to click the “Deploy” button. You can check out my google app at http://math-quiz.srinivasan.biz/.

Leave a Reply

Your email address will not be published. Required fields are marked *