XmlConfiguration configuration = new XmlConfiguration(jettyEnv.getURL()); configuration.configure(getWebAppContext());
Resource jettyEnv = webInf.addPath("jetty-env.xml"); if(jettyEnv.exists()) { jettyEnvXmlUrl = jettyEnv.getURL(); }
    public void configureWebApp() throws Exception    {        //create a java:comp/env        createEnvContext();                //add java:comp/env entries for any globally defined EnvEntries        addGlobalEnvEntries();                //create a special context in the global namespace that is        //a place to bind any webapp specific jndi entries so that        //they can be found during the parsing of web.xml        InitialContext icontext = new InitialContext();        localContext = icontext.createSubcontext(Long.toString(getWebAppContext().hashCode(),36)+getWebAppContext().getContextPath().replace('/','_'));        NamingEntry.setThreadLocalContext(localContext);                        //look for a file called WEB-INF/jetty-env.xml        //and process it if it exists        Resource webInf = getWebAppContext().getWebInf();        if(webInf!=null && webInf.isDirectory())        {            Resource jettyEnv = webInf.addPath("jetty-env.xml");            if(jettyEnv.exists())            {                XmlConfiguration configuration = new XmlConfiguration(jettyEnv.getURL());                configuration.configure(getWebAppContext());            }        }                //add java:comp/env entries for all webapp-specific EnvEntries        addLocalEnvEntries();    }