Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Documentation Link: <a href="http://www.eclipse.org/jetty/documentation/current/configuring-specific-webapp-deployment.html">Configuring a Specific Web Application Deployment</a></p> <p>A "context xml" is any XML file that :</p> <ol> <li>Follows the <a href="http://www.eclipse.org/jetty/documentation/current/reference-section.html#jetty-xml-syntax">Jetty IoC XML syntax</a></li> <li>Configures a <a href="http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/webapp/WebAppContext.html"><code>org.eclipse.jetty.webapp.WebAppContext</code></a></li> <li>And is in a directory that your deployer recognizes</li> </ol> <p>For #2 (Configuring a WebAppContext), an example for Jetty 9 would be</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"&gt; &lt;Configure class="org.eclipse.jetty.webapp.WebAppContext"&gt; &lt;Set name="contextPath"&gt;/myapp&lt;/Set&gt; &lt;Set name="war"&gt;&lt;Property name="jetty.webapps" default="."/&gt;/myapp.war&lt;/Set&gt; &lt;Set name="extractWAR"&gt;true&lt;/Set&gt; &lt;/Configure&gt; </code></pre> <p>For #3, the deployer directory, that is determined by your own setup and configuration.</p> <p>See <a href="https://github.com/eclipse/jetty.project/blob/master/jetty-deploy/src/main/config/etc/jetty-deploy.xml"><code>etc/jetty-deploy.xml</code></a> and look for what your <code>monitoredDirName</code> is.</p> <ul> <li>For Jetty 9.1+, that's <code>${jetty.base}/webapps/</code></li> <li>For Jetty 8 that's <code>${jetty.home}/contexts/</code> see (<a href="https://github.com/eclipse/jetty.project/blob/jetty-8.1.14.v20131031/jetty-deploy/src/main/config/etc/jetty-contexts.xml"><code>etc/jetty-contexts.xml</code></a>)</li> <li>For Jetty 7 that's <code>${jetty.home}/contexts/</code> see (<a href="https://github.com/eclipse/jetty.project/blob/jetty-7.6.14.v20131031/jetty-deploy/src/main/config/etc/jetty-contexts.xml"><code>etc/jetty-contexts.xml</code></a>)</li> </ul> <p>Jetty 7 and Jetty 8 had a quirk in the deployers that was poorly understood, you could deploy a webapp as a WAR via the webapp deployer, or as Context via the context deployer, and if you had both deployers, your webapp would be deployed twice. (confusing endless numbers of people).</p> <p>With Jetty 9, the 2 deployer techniques were merged to make them aware of each other and prevent duplicate webapp deployment.</p> <p><strong>The logic for deployment in Jetty 9 is as follows:</strong></p> <p>The webapps directory (aka <code>monitoredDirName</code>) is scanned by the <a href="http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/deploy/providers/WebAppProvider.html">WebAppProvider</a>.</p> <p>This provider scans one or more directories (typically "webapps") for contexts to deploy, which may be:</p> <ul> <li>A standard WAR file (must end in <code>".war"</code>)</li> <li>A directory containing an expanded WAR file</li> <li>A directory containing static content</li> <li>An XML descriptor Jetty IoC XML Syntax that configures a ContextHandler or WebAppContext instance</li> </ul> <p>To avoid double deployments and allow flexibility of the content of the scanned directories, the provider implements some heuristics to ignore some files found in the scans:</p> <ul> <li>Hidden files (starting with <code>"."</code>) are ignored</li> <li>Directories with names ending in <code>".d"</code> are ignored</li> <li>If a directory and a WAR file exist ( eg <code>foo/</code> and <code>foo.war</code>) then the directory is assumed to be the unpacked WAR and only the WAR is deployed (which may reused the unpacked directory)</li> <li>If a directory and a matching XML file exist ( eg <code>foo/</code> and <code>foo.xml</code>) then the directory is assumed to be an unpacked WAR and only the XML is deployed (which may used the directory in it's configuration)</li> <li>If a WAR file and a matching XML exist (eg <code>foo.war</code> and <code>foo.xml</code>) then the WAR is assumed to be configured by the XML and only the XML is deployed.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload