---
title: "GWT涂鸦(1)——Starter Project"
author: "ratlsun"
date: "2010-12-01T22:52:05Z"
tags: []
categories: ["Web前端"]
slug: "gwt-1-starter-project"
draft: false
lastmod: "2010-12-02T10:47:41Z"
id: 830942
url: "https://ratlsun.iteye.com/blog/830942"
---

## The module XML file

### 位置：src/包/项目名.gwt.xml

### 内容：

模块：项目名全小写

继承User  
继承Standard theme

entry-point：client包下的项目文件名为类名的类

源client  
源shared

## The Host Page

### 位置：war/项目名.html

### 内容：

meta tag  
css: 项目名.css  
js: 模块名/模块名.nocache.js

 

```
    <h1>Web Application Starter Project</h1>
    <table align="center">
      <tr>
        <td colspan="2" style="font-weight:bold;">Please enter your name:</td>        
      </tr>
      <tr>
        <td id="nameFieldContainer"></td>
        <td id="sendButtonContainer"></td>
      </tr>
      <tr>
        <td colspan="2" style="color:red;" id="errorLabelContainer"></td>
      </tr>
    </table>
```

   
![](http://dl.iteye.com/upload/attachment/358466/d4435332-c41a-3821-852a-7bb8ac81a838.jpg)

 

 

## The Application Style Sheet

### 位置：war/项目名.css

### 内容：...

 

## The Entry Point Class

### 位置：src/包.client/项目名.java

### 内容：

创建异步service的接口实现proxy对象作为private final属性：依赖服务注入；

创建[组件](http://code.google.com/intl/zh-CN/webtoolkit/doc/latest/RefWidgetGallery.html) 对象作为private final属性（@question临时变量or属性 ）；

实现EntryPoint.onModuleLoad()：布局+组件设置+事件设置；