updated global binding test

This commit is contained in:
Greg Wilkins 2016-10-06 12:58:15 +11:00
parent dfabd48149
commit 7310067954
3 changed files with 19 additions and 3 deletions

View File

@ -27,6 +27,7 @@ import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.webapp.WebAppClassLoader;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.xml.XmlConfiguration;
@ -102,7 +103,7 @@ public class GlobalWebappConfigBinding implements AppLifeCycle.Binding
jettyXmlConfig.getProperties().put("jetty.webapp",file.getCanonicalPath());
jettyXmlConfig.getProperties().put("jetty.webapps",file.getParentFile().getCanonicalPath());
jettyXmlConfig.configure(context);
WebAppClassLoader.runWithServerClassAccess(()->{jettyXmlConfig.configure(context);return null;});
}
else
{

View File

@ -1,7 +1,9 @@
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call name="addServerClass">
<Arg>org.eclipse.foo.</Arg>
<Call name="getServerClasspathPattern">
<Call name="include">
<Arg>org.eclipse.foo.</Arg>
</Call>`
</Call>
<!-- Array id="serverClasses" type="java.lang.String">

View File

@ -777,6 +777,19 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
return _serverClasses.getPatterns();
}
/* ------------------------------------------------------------ */
@Deprecated
public void addSystemClass(String clazz)
{
_systemClasses.add(clazz);
}
/* ------------------------------------------------------------ */
@Deprecated
public void addServerClass(String clazz)
{
_serverClasses.add(clazz);
}
/* ------------------------------------------------------------ */
@Override