Jump to: navigation, search

Jetty/Feature/Hot Deployment


Jetty provides capability to deploy an arbitrary context or web application with Jetty-specific configuration. This capability is implemented via ContextDeployer mechanism.


The ContextDeployer may be used to (hot)deploy an arbitrary Context or Web Application with Jetty specific configuration. To statically deploy only standard web applications at startup, use the WebAppDeployer.


Typically a ContextDeployer is defined in a jetty.xml file:

 <Call name="addLifeCycle">
     <New class="org.eclipse.jetty.deployer.ContextDeployer">
       <Set name="contexts"><Ref id="Contexts"</Set>
       <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
       <Set name="scanInterval">1</Set>

The ContextDeployer will scan the configurationDir directory at intervals of scanInterval seconds for xml descriptors that define contexts. Any contexts found are deployed to the passed contexts reference to a HandlerContainer (this is normally an instance of ContextHandlerCollection).

The deployment descriptors are in [Jetty/Reference/jetty.xml syntax