Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Jetty/Feature/Hot Deployment



Introduction

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

Feature

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.

Overview

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

 
 <Call name="addLifeCycle">
   <Arg>
     <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>
     </New>
   </Arg>
 </Call>

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

Back to the top