package nl.dvberkel;

public class WebServer {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

@@ -19,121 +19,1506 @@
 l;%0A%0A
-public class WebServer %7B%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(%22Hello, World!%22)
+import nl.dvberkel.context.TreeContextConfiguration;%0Aimport org.eclipse.jetty.server.Handler;%0Aimport org.eclipse.jetty.server.Server;%0Aimport org.eclipse.jetty.servlet.ServletContextHandler;%0Aimport org.eclipse.jetty.servlet.ServletHolder;%0Aimport org.springframework.context.annotation.AnnotationConfigApplicationContext;%0Aimport org.springframework.web.context.ContextLoaderListener;%0Aimport org.springframework.web.context.WebApplicationContext;%0Aimport org.springframework.web.context.support.AnnotationConfigWebApplicationContext;%0Aimport org.springframework.web.servlet.DispatcherServlet;%0A%0Apublic class WebServer %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        Server server = new Server(8080);%0A        server.setHandler(createServletContextHandler(getContext()));%0A        server.start();%0A        server.join();%0A    %7D%0A%0A    private static Handler createServletContextHandler(WebApplicationContext context) %7B%0A        ServletContextHandler handler = new ServletContextHandler();%0A        handler.setErrorHandler(null);%0A        handler.setContextPath(%22/%22);%0A        handler.addServlet(new ServletHolder(new DispatcherServlet(context)), %22/*%22);%0A        handler.addEventListener(new ContextLoaderListener(context));%0A        return handler;%0A    %7D%0A%0A    private static WebApplicationContext getContext() %7B%0A        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();%0A        context.register(TreeContextConfiguration.class);%0A        return context
 ;%0A  

Create a webserver