I\'m writing some example code where an embedded Jetty server is started. The server must load exactly one servlet, send all requests to the servlet and listen on localhost:80>
Works with Jetty 8:
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
public class Main {
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
WebAppContext handler = new WebAppContext();
handler.setResourceBase("/");
handler.setContextPath("/");
handler.addServlet(new ServletHolder(new MyApp()), "/*");
server.setHandler(handler);
server.start();
}
}