context.setClassLoader(new WebAppClassLoader(Thread.currentThread().getContextClassLoader(), context));
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(context.getClassLoader());
Context icontext = new InitialContext();
Context compCtx = (Context)icontext.lookup ("java:comp");
compCtx.createSubcontext("env");
Thread.currentThread().setContextClassLoader(oldLoader);
org.eclipse.jetty.plus.jndi.Resource ds = new org.eclipse.jetty.plus.jndi.Resource (context, "jdbc/mydatasource", new Object());
URL webXml = Thread.currentThread().getContextClassLoader().getResource("web.xml");