Getting Start with GWT(Part I)

本文介绍了作者因工作需求开始学习GWT框架的过程。从下载安装到创建第一个应用,并分享了在学习过程中遇到的问题及解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Well, I eventually have to learn GWT, a matural web application framework published for 5 years. 

 

Two weeks ago, my big boss, new architect, Bruce Lee (Lee Stroke, We call him Bruce Lee due to he has a nice face looks like Bruce Willis) asked me to take a look GWT after i finished the presentation of JBolt.  Frankly speaking, i don't like HTML related technologies like jQuery, DWR, even EXT JS. I always have a concept that plain http based technologies are the critical issue which causes performance of desktop application decreases rapidly. But, considering popularizing jbolt platform, i decided to get start with GWT and to take a look what magic things it has.

 

1. Download GWT-2.0.3 from google offical website.

2. Unzip GWT-2.0.3

3. Read getting start document

4. Create my own application

 

In order to learn it quickly, i downloaded e-Book "GWT in Action" and went through chapter 1 "Getting Start". It just tells you to run command "applicationCreator" at first for setting up development environment. Unfortunately, it doesn't exist in version 2.0.3. Thus, don't be confused by book, just use command

 

webAppCreator -out MyWebApp jbolt.gwt.MyWebApp

 

to generate a number of files in folder "MyWebApp". If you are a wise man, you should take a look help information of command "webAppCreator". -out represents the path of output directory. In this case, i like to change it to "C:/Development/GWTProjects/MyWebApp". The following argument is used to specify the entry point class which can be regarded as a "main" class of GWT web application. I will introduce it later on.

After running this command, a project structure is constructed in "MyWebApp". Just as its names implied, "src" stores java source files, while "war" is a web root directory storing html related files such as html, css, js files, images, and WEB-INF directory.

 

After then, we can create a project in IDE. I hate learning a new framework with a specific IDE, especially eclipse. If you want to become a master, you should not rely on a specific IDE too much. Thus, i created a simple java project based on "MyWebApp" as a root directory. Likewise, i imported "war/WEB-INF/lib/gwt-servlet.jar" and "jsp-api.jar" as well as "servlet-api.jar" (You can find it in "%TOMCAT_HOME%/lib", if you have installed tomcat in your local environment) to dependencies.

 

Now, I have finished the preparation of first GWT application. According to the document, i chanaged directory to MyWebApp, and execute command

 

ant devmode

Obviously, it's a ant command. If you haven't installed ANT, please download it from apache website, and set corresponding path properly.

 

After running this command, a window appears on the screen. In the development mode window you will find the URL for the local server. Paste this URL into browser. You can see the first application.

 

Great! In the next part, i will detaily explain java source code of this application.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值