Restlet edition for Google App Engine


Google provides a Java version of his App Engine solution (GAE). It is a PaaS (Platform as a Service) solution that offers massive and flexible scalability for your Web applications by hosting them on the Google cloud (based on Google computing infrastructure).

Due to the restrictions of the GAE, we need to provide an adaptation of Restlet for this environment. GAE is based on Java 6, with a restricted list of APIs. See GAE developers documentation for details.

Modules availables:

  • Restlet core (API + Engine)
  • Restlet extension - Javamail (SMTP client)
  • Restlet extension - Net (HTTP and HTTPS client)
  • Restlet extension - Servlet (HTTP and HTTPS server)
  • Restlet extension - XML (DOM, SAX and XPath)

Usage example

Create a new GAE project with the Eclipse plugin provided, add the “org.restlet.jar” and the “org.restlet.ext.servlet.jar” files from the latest Restlet snapshots(make sure you download the edition for GAE) to your “/war/WEB-INF/lib/” directory and to your project build path.

Here is the Restlet resource to create:

package firstSteps;

import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

 * Resource which has only one representation.
public class HelloWorldResource extends ServerResource {

    public String represent() {
        return "hello, world (from the cloud!)";


Now here is the parent application:

package firstSteps;

import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.routing.Router;

public class FirstStepsApplication extends Application {

     * Creates a root Restlet that will receive all incoming calls.
    public Restlet createInboundRoot() {
        // Create a router Restlet that routes each call to a
        // new instance of HelloWorldResource.
        Router router = new Router(getContext());

        // Defines only one route

        return router;

Finally, here is the Servlet configuration file:

<?xml version="1.0" encoding="utf-8"?>
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<web-app xmlns="" version="2.5">
         <display-name>first steps servlet</display-name>

                         <param-value>firstSteps.FirstStepsApplication  </param-value>

    <!-- Catch all requests -->

For more information on Restlet, please check our documentation pages.


The Javadocs of the Restlet edition for GAE are available online as well: