Hi All:

To get to the Server object from a ServletConfig I use:

    public static Server getServer(final ServletConfig servletConfig) {
        final ServletContext servletContext =
servletConfig.getServletContext();
        if (servletContext instanceof ServletContextHandler.Context) {
            final ServletContextHandler.Context jettyServletContext =
(ServletContextHandler.Context) servletContext;
            return jettyServletContext.getContextHandler().getServer();
        }
        return null;
    }

But, in 8.1.3,
org.eclipse.jetty.server.handler.ContextHandler.Context.getContextHandler()
is defined as:

        public ContextHandler getContextHandler()
        {
            // TODO reduce visibility of this method
            return ContextHandler.this;
        }

Implementing this TODO would torpedo my solution.

Is there better way to get the Server object from a ServletConfig?

Thank you,
Gary

-- 
E-Mail: [email protected] | [email protected]
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to