tags:

views:

526

answers:

1

Hi, I'm trying to register a Servlet in Jetty 7.0 programmatically. All the examples I find are for Jetty 6, and Jetty 7 is quite different. Here is my server side:

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;

public class Bootstrapper {
     public static void main(String[] args) throws Exception{
         Server server = new Server(8080);
         ServletContextHandler servletContextHandler = new ServletContextHandler(server, "/context", true, false);
         servletContextHandler.addServlet(HessianService.class, "/hessian-service");
         server.start();
         System.out.println("started");
     }

}

The result of this test is the sever starts, but the client fails on connect: Caused by: java.io.FileNotFoundException: http://localhost:8080/hessian-service

I see nothing in my browser at http://localhost:8080/hessian-service. Thanks

+1  A: 

The URL to access your servlet is http://localhost:8080/context/hessian-service

adrian.tarau
Yep, I tarded :)
phil swenson