I try to write blogs whenever I get spare time

Just to let you know what I am trying to learn and what I am doing now.

Getting Started with GWT 1.6.* and Google App Engine

There has been few drastic changes made in GWT 1.6 . The most important one is the new project structure. GWT now uses a "war" directory for most public resource and server configuration files. For the total change list, visit this page.

My previous post "Getting Started With the GWT " was fine for the previous version(1.5.*) of GWT. But, since things are not the same now, I am writing another tutorial for the new version of GWT.

  1. At first, download the latest build of GWT 1.6 from here.
  2. Unzip it to any location in your Hard drive.
  3. Now, add the Google Plugin in your Eclipse IDE. You can follow my another blog.
  4. Now choose File>New>Web Application Project. Or, you can click the "New Web Application Project" button from the newly added Google Toolbar.
  5. Give a project name and package structure. Leave other options as default.
  6. After finishing the "New Web Application" wizard, a default template GWT project would be created according to your given name.
  7. You'll get a nice starting project after that. Moreover, you'll get an RPC communication mechanism as default in this project. If you look at the project structure, you'll find 3 files GreetingService.java, GreetingServiceAsync.java, GreetingServiceImpl.java in the project. This three files would be used if you need Server-Client communication.
  8. Now, if you want to develop a web app that will not need any server communication, you have to delete some stuffs from the project.
  • Delete those three files. GreetingService.java and GreetingServiceAsync.java are located in your client package. And, GreetingServiceImpl.java is located in the server package.
  • Open the "web.xml" file from the "war -> WEB-INF".
  • Delete texts starting form "" to "". This portion of xml code is used for the server side servlet mapping.
Now you can write a web app that doesn't use server-client communications.
If you want to deploy your application in the Google App Engine, follow these steps:
  1. Sign up in Google App engine
  2. Then sign in with your account.
  3. Then click on the "Create an application" button.
  4. Give a application ID and title of your app and click "save".
  5. Your application is created.
  6. Now go back to Eclipse. Right click on the project from the "package explorer" tab.
  7. Select "Deploy to App Engine" from the "Google" sub-menu.
  8. Choose the "App Engine Project Settings" from the dialog.
  9. Give the Application ID (It is the app ID you have created earlier) and the version number. Click ok.
  10. Then give your email (Google id) and password, click Deploy.
  11. Your project would be compiled and deployed to the Google App Engine.
And, that's all. You would be able to run your web app from the "http://xyz.appspot.com", where xyz stands for your application ID.

0 comments:

Post a Comment