Web Application Deployer
The WebAppDeployer replaces the static method call org.mortbay.jetty.webapp.WebAppContext.addWebApplications that was used to discover and deploy webapplication during startup. This method is now deprecated, but still works (by calling an instance of WebApplicationDeployer).
The basic operation of WebAppDeployer is to scan a directory at startup for WAR files or webapp directories and the deploy the webapplications found. Typically this is done from a jetty.xml file:
The WebAppDeployer is added to the server as a LifeCycle. This simply means that the deployer will be started and stopped with the server. Ie when server.start() is called, then start will also be called on the deployer.
The context passed in is a reference to a HandlerContainer in which the discovered webapps will be deployed. This is normally an instance of ContextHandlerCollection.
The webAppDir is a file path or URL to the directory to scan for webapplications. Zip files ending with .war or .zip are deployed. Directories not call CVS are also deployed. The basename of the war (eg foo from foo.war) or the directory name are used as the context path of the discovered webapps, unless the name is "root", in which case the context path of / is used.
If the extract parameter is true, any packed war or zip files will first be extracted to a temporary directory before being deployed. This is advisable if there are uncompiled JSPs in the web apps.
If the allowDuplicates parameter is false, the discovered webapps will be checked against existing deployed webapps and will not be deployed if the same context path or war files is already deployed (perhaps by another deployer).
The defaultsDescriptor parameter allows an alternative webdefault.xml to be set on the discovered web applications. The webdefault.xml file is used to control the configuration of the JSP and Default servlets.