Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

What is jetty.xml?

The jetty.xml file is a default configuration file for Jetty and is located at $JETTY_HOME/etc/jetty.xml. You can call the file anything and it can be located anywhere in the filesystem. It is supplied to jetty on the runline like so:

Code Block
java -jar start.jar etc/jetty.xml

You can also have more than one configuration file:

Code Block
java -jar start.jar etc/abcd.xml etc/xyz.xml

If the id of the server is the same in each configuration file, then the same server is configured by each file and the configurations are added together. If the id of the server is different, then each config file will create a new Server instance within the same JVM.

The configuration files may be parametrized with either System properties (using SystemProperty tag) or properties files (using Property tag) passed on the command line. eg

Code Block
java -Djetty.port=8888 -jar start.jar myjetty.properties etc/jetty.xml etc/other.xml

The jetty configuration format is a simple mapping from XML to java. With this format you can call the methods defined in the javadoc to configure a server. There is a more in-depth look this syntax and the jetty.xml file in the Syntax Reference section.

If you need to perform more specific setup on a webapp, you can use the jetty-web.xml file.

See Walkthrough for a detailed explanation on the use cases.

Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery