I've followed the example in "First Steps" for GAE and can't seem to access the resource from the browser.
I'm running:
- latest snapshot build for gae (as of 10/25/09)
- AppEngine 1.2.6
- Eclipse 3.5
I've attached the relevant files.
Any help greatly appreciated!
Michael
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns="
http://java.sun.com/xml/ns/javaee" xmlns:web="
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
>
<display-name>TestApp</display-name>
<!-- Application class name -->
<context-param>
<param-name>org.restlet.application</param-name>
<param-value>testapp.rest.DefaultApplication</param-value>
</context-param>
<!-- Restlet adapter -->
<servlet>
<servlet-name>RestletServlet</servlet-name>
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
</servlet>
<!-- Catch all requests -->
<servlet-mapping>
<servlet-name>RestletServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
package testapp.rest;
import javax.ws.rs.Path;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
@Path("test")
public class TestResource extends ServerResource
{
@Get @Path("hello")
public String represent()
{
return "hello";
}
}
package testapp.rest;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;
public class RestConfig extends Application
{
public Set<Class<?>> getClasses()
{
Set<Class<?>> restResources = new HashSet<Class<?>>();
restResources.add(TestResource.class);
return restResources;
}
}
package testapp.rest;
import org.restlet.Context;
import org.restlet.ext.jaxrs.JaxRsApplication;
public class DefaultApplication extends JaxRsApplication
{
public DefaultApplication(Context context)
{
super(context);
this.add(new RestConfig());
}
}