Jetty: Pass object from main method with WebAppProvider to Servlet
问题 I need to pass an object from the embedded jetty code in a main method to be used in a servlet. This is an issue because of the separate classloader used within the WebAppContext - otherwise I would just use a static variable. My main code sets things up like this: Server server = new Server(); // setup connectors here... ContextHandlerCollection contexts = new ContextHandlerCollection(); RequestLogHandler requestLogHandler = new RequestLogHandler(); HandlerCollection handlers = new