Hi Simone,
Thank you for the suggestion. I tried it but it didn't work because getServer() returns null at the time the WebAppContext instance is configured.
Instead, I tried a slight variation on your idea. I added the connector and the WebAppContext handler explicitly to the server calling setHandler (see below). Do you think this is a reasonable way to do it?
Thanks,
Josh
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Map id="myContext">
...
</Map>
<Set name="Handler">
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/mywar</Set>
<Set name="war">mywar.war</Set>
<Get name="ServletContext">
<Call name="setAttribute">
<Arg>adb-context</Arg>
<Arg><Ref refid="myContext"/></Arg>
</Call>
</Get>
</New>
</Set>
<Call name="addConnector">
<Arg>
<New id="myConnector" class="org.eclipse.jetty.server.ServerConnector">
<Arg name="server"><Ref refid="Server"/></Arg>
<Arg name="factories"><Array type="org.eclipse.jetty.server.ConnectionFactory"/></Arg>
</New>
</Arg>
</Call>
<Ref refid="myConnector">
<Call name="addConnectionFactory">
<Arg>
<New class="com.example.TestConnectionFactory">
<Arg><Ref refid="myContext"/></Arg>
</New>
</Arg>
</Call>
</Ref>
</Configure>