8
I use jetty6 in simple application as embedded servlet container. I decided to update it to Jetty 8. In jetty 6 it was pretty simple to start the server:
Server server = new Server(8080);
Context context = new Context(server, "/", Context.SESSIONS);
context.addServlet(MyServlet.class, "/communication-service");
server.start();
but it doesn't work in Jetty8. Unfortunately I can't find any simple example for this version. Can't instantiate Context with error
an enclosing instance that contains
org.eclipse.jetty.server.handler.ContextHandler.Context is required
because now it is an inner class and also no such constructor.
Most examples are for jetty 6 and 7. Could you please provide simple example how to start servlet at jetty 8?