With a bit of luck and glue code, it can.
So first we need a Service Provider Implementation (SPI) from Jetty: J2se6HttpServerSPI
This will make the JAX-WS endpoint use the Jetty server instead its default Sun HttpServer.
To plugin different SPI's you would define this new service in a META-INF/services file, but you can also set a system property, as described here. You can even do this in code which reduces the number of files you need to worry about when refactoring.
So here's an example of a Jetty Server handling a JAX-WS endpoint in combination with a File system directory.
Server jettyServer = new Server(port);
HandlerCollection handlerCollection = new HandlerCollection();
jettyServer.setHandler(handlerCollection);
/** 1) Publish WebService (JettyHttpServerProvider) */
String context = "/web/ws";
// 1.1) register THIS Jetty server with the JettyHttpServerProvider
new JettyHttpServerProvider().setServer(jettyServer);
// 1.2) make sure JAX-WS endpoint.publish will use our new service provider: JettyHttpServerProvider
System.setProperty("com.sun.net.httpserver.HttpServerProvider",
"org.mortbay.jetty.j2se6.JettyHttpServerProvider");
// 1.3) add an empty HandlerCollection to by setup by this provider
handlerCollection.addHandler( new HandlerCollection() );
// 1.4) use JAX-WS API to publish the endpoint (will use a JettyHttpServerProvider)
Endpoint endpoint = Endpoint.create(replayServiceImpl);
endpoint.publish("http://localhost:" + port + "/web/ws", replayServiceImpl);
/** 2) Publish WebGUI (Jetty) */
String context = "/gui";
// 2.1) configure File Resource Handler
ResourceHandler fileResourceHandler=new ResourceHandler();
fileResourceHandler.setWelcomeFiles(new String[]{"index.html"});
fileResourceHandler.setResourceBase(guiPath); // start here
// 2.2) configure 'gui' Context
ContextHandler guiHandler = new ContextHandler();
guiHandler.setContextPath(context);
guiHandler.setResourceBase(".");
guiHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
guiHandler.setHandler(fileResourceHandler);
// 2.3) add this context handler
handlerCollection.addHandler(guiHandler);
/** 3) start JETTY server */
jettyServer.start();
jettyServer.join();