Skip to content

Getting started with GWT

pierreh edited this page Jun 19, 2012 · 26 revisions

[In Progress]

Setting up your pom.xml

You will need the following dependencies to get started:

    <dependencies>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-gwt-client</artifactId>
            <version>1.0.0.beta1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-gwt-server</artifactId>
            <version>1.0.0.beta1</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>2.4.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>2.4.0</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.6.1</version>
        </dependency>
    </dependencies>

The atmosphere-gwt-client has scope provided because these Java classes will be transformed to javascript and are included into the resulting war package.You should select the slf4j package for the logging framework that you will use. Here we selected the jdk14 bridge for java.util.logging. You can defined the following properties for convenience and we will refer to them in this document:

    <properties>
        <gwtModule>org.atmosphere.samples.GWTDemo</gwtModule>
        <war.target>${basedir}/src/main/webapp</war.target>
        <gwt.compiler.force>false</gwt.compiler.force>
        <gwt.draftCompile>false</gwt.draftCompile>
        <gwt.style>OBF</gwt.style>
        <outputDir>${war.target}/WEB-INF/classes</outputDir>
    </properties>

defines the basename and package of your main .gwt.xml file. So in the case of the gwt-demo it is located in src/main/resources/org/atmosphere/samples/GWTDemo.gwt.xml

Running the GWT shell while deployed in a JavaEE container of your choice

What you should do is specify true in the configuration of the maven-gwt-plugin and deploy the war to your tomcat server. After the war is deploy you should run "mvn gwt:run" and the shell will start without starting the build-in jetty. Now you type the url of your page that is hosted by tomcat and add "?gwt.codesvr=127.0.0.1:9997" to the url. This will redirect the javascript to the gwt shell.

Read more about the GWT Maven Plugin

Step by Step Tutorials

Concepts & Architecture

15 Minutes Tutorial

Advanced Topics

API

Known WebServer Issues

References

External Documentations

githalytics.com alpha

Clone this wiki locally