Hi Jerome,
I wanted to update my code. Before that in order to comprehend things
I started implementing some simple use cases. The following code
doesn't work as intended.... I always get a 404
public class Playground {
public static void main(String[] args) throws Exception {
Container container = new Container();
ServerList servers = container.getServers();
Protocol httpProtocol = Protocol.HTTP;
String ipAddress = "127.0.0.1";
int httpPort = 8182;
servers.add(httpProtocol, ipAddress, httpPort);
VirtualHost host = new VirtualHost(container.getContext());
host.getAllowedProtocols().add(httpProtocol);
host.getAllowedPorts().add(httpPort);
host.getAllowedAddresses().add(ipAddress);
//host.attach("", new Restlet() {
host.attach("/something", new Restlet() {
protected void handleGet(Request request, Response response) {
response.setEntity("Hello World!", MediaType.TEXT_PLAIN);
}
});
container.setDefaultHost(host);
//container.getHosts().add(host);
container.start();
}
}
The commented parts don't work either.
Did I miss something here?
Cheers
Piyush