[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jetty-dev] registering a servlet programmatically in jetty 7
|
Hi, I'm trying to register a Hessian 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");
}
}
here is my client side:
import com.caucho.hessian.client.HessianProxyFactory;
public class HessianClient {
public static void main(String[] args) throws Exception {
String url = "" href="http://localhost:8080/hessian-service">http://localhost:8080/hessian-service";
HessianProxyFactory factory = new HessianProxyFactory();
IHessianService basic = (IHessianService) factory.create(IHessianService.class, url);
basic.getAllContacts();
for (String arg : args) {
System.out.println("arg = " + arg);
}
}
}
I don't think that the servlet is being registered properly on the server side. I see nothing in my browser at
http://localhost:8080/hessian-service (although since it's a hessian service, I don't actually know what to expect). Thanks
thanks