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
The URL to access your servlet is http://localhost:8080/context/hessian-service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With