Search This Blog

Saturday, July 30, 2011

GWT - Creating new project and removing unnecessary stuff

  This is an easy step, but as always there are some secrets - what to do better...at least what was better for me.
  1. Create new web application

   2. Insert project name, package name. As you can see I am putting my projects in Apache's public folder (read my last post for reasons).  Uncheck Google App Engine, because when I started using GWT, didn't understand why my project doesn't work when there is no Internet connection...this was the reason...GWT was communicating with some kind App Engine's API online. And leave sample code checkbox enabled.

  3. Then you can delete unnecessary files ...

  4. You can delete everything in projectName.css. Have to delete heading and table tags in projectName.html. And web.xml has descriptions of servlets. Hopefully servlets were deleted, when you deleted files, but if they still are there just remove them, or else it won't be possible to compile project.
  5.You could have left projectName.java file undeleted and just removed unnecessary code, but it's easier to delete and just create a new one like this....
6. Now you can choose design mode, add a button and add click event to it....easy. At first I was confused when didn't see the Design tab. When it happens you just have to right click your file and choose
 Open With -> GWT Designer.

  When everything is ready right click project, choose Debug As -> Web Application (running on external server)... choose this option if your project is in Apache directory as I told in previous post. Otherwise choose just Web Application. Click the link, install browsers plugin, and  there you have...your project is running. :)
  After that if changes are made to source code, only browser has to be reloaded. No need of restarting applications debug mode. And when application is ready, choose Compile Project. Then everything in war folder can be put on server and your web application is ready.

No comments:

Post a Comment