Jetty by default includes the etc/jetty-deploy.xml
file in start.ini
, which
configures a web application Deployer that hot deploys files found in the webapps
directory. Standard
WAR files and jetty configuration files that are placed in the webapps
directory will be hot deployed to
the server with the following conventions:
A directory called example/
will be deployed as a standard web application if it contains a
WEB-INF/
subdirectory, otherwise it will be deployed as context of static content. The context path
will be /example
(eg http://localhost:8080/example/
) unless the base name is
root
, in which case the context path is /. If the directory name ends with ".d" it is ignored (by may be
used by explicit configuration).
A file called example.war
will be deployed as a standard web application with the context path
/example (eg http://localhost:8080/example/). If he base name is root, then the context path is /. If
example.war
and example/
exist, then only the WAR is deployed (which may use the directory as
an unpack location).
An XML file like example.xml
will be deployed as a context whose configuration is defined by
the XML. The context path must be set by the configuration itself. If example.xml
and
example.war
exist, then only the XML is deployed (which may use the war in its configuration).
If you have a standard web application, it can hot deployed into jetty by copying it into the webapps directory. Alternately to test deployment you can copy the provided test web application provided:
> cp webapps/test.war webapps/myapp.war
The Jetty distribution comes with the following deployed in the webapps directory:
The Jetty welcome page served as static content.
The configuration file that deploys the demonstration web application in test.war using the extra configuration contained within test.d
The demonstration web application that is configured and deployed by test.xml
A directory containing additional configuration files used by test.xml
A web application demonstration asynchronous REST to Ebay.
A context configuration that deploys as static content the javadoc directory found at jetty.home/javadoc
These demonstration web applications should be removed before using Jetty in production.