I worked out a simple hello world application using Restlet in GWT, but it throwed out me with
"No available client connector supports the required protocol: 'HTTP'" in client side and in server side
"No available server connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath."
Here is my hello world app:
Client:
import org.restlet.resource.ClientResource;
public class HelloClient {
public static void main(String[] args) throws Exception {
ClientResource helloClientresource = new ClientResource(
"http://localhost:8111/");
helloClientresource.get().write(System.out);
}
}
ServerResource:
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
/**
* Simple "hello, world" server resource.
*/
public class HelloServerResource extends ServerResource {
@Get("txt")
public String represent() {
return "hello, world";
}
}
Server:
import org.restlet.Server;
import org.restlet.data.Protocol;
public class HelloServer {
public static void main(String[] args) throws Exception {
Server helloServer = new Server(Protocol.HTTP, 8111,
HelloServerResource.class);
helloServer.start();
}
}