Deploy GWT sample application in Servlet container


Since the example project provides a basic Restlet-powered server, it should be easy to deploy it inside a servlet container. GWT does not provide standard way to achieve this task, however, you can still get more information at this URL :

Our sample application is composed of:

  • a client part: static page and files generated by the compilation of the class,
  • and a server part: that serves resources called from the static page and serves the static files (via a Directory Restlet).

The main task is to generate a correct WAR file. Hopefully this is not very difficult.

Set up the WAR file

Here is the content of the target WAR file:

    - web.xml
    + lib
        - org.restlet-2.0rc3.jar: Restlet core archives
        - org.restlet.ext.servlet-2.0rc3.jar: Servlet adapter for Restlet
        - org.restlet.ext.gwt-2.0rc3.jar: Server-side integration with GWT 1.7.
        - org.restlet.ext.crypto-2.0rc3.jar: Extension that provide support of the HTTP_DIGEST challenge scheme
        - org.restlet.ext.xml-2.0rc3.jar: XML extension
        - org.restlet.ext.json-2.0rc3.jar, org.json.jar: JSON extension
        - RestletGWTSimpleExample.jar: generated by the ant script, contains the static pages and the code of the server application.

Here the content of the web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        <param-value>CLAP FILE WAR</param-value>