blob: 37793e32e4b9f032d1953d2520892395c3ae0a51 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter&nbsp;32.&nbsp;Jetty XML Reference</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty"><link rel="up" href="jetty-ref-guide.html" title="Part&nbsp;V.&nbsp;Jetty Reference Guide"><link rel="prev" href="ubuntu.html" title="Ubuntu"><link rel="next" href="jetty-xml-usage.html" title="Jetty XML Usage"><link xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" rel="shortcut icon" href="images/favicon.ico"><link rel="stylesheet" href="css/highlighter/foundation.css"><script src="js/highlight.pack.js"></script><script>
hljs.initHighlightingOnLoad();
</script><link type="text/css" rel="stylesheet" href="css/font-awesome/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small">
Version: 9.4.28-SNAPSHOT</span></td><td style="width: 50%"></td></tr></table><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;32.&nbsp;Jetty XML Reference</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ubuntu.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;V.&nbsp;Jetty Reference Guide<br><a accesskey="p" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="jetty-xml-usage.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr></table><hr></div><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at
<span class="website">www.webtide.com</span></a></h5><p>
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 for sponsored feature development
</p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="reference-section"></a>Chapter&nbsp;32.&nbsp;Jetty XML Reference</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="reference-section.html#jetty-xml-syntax">Jetty XML Syntax</a></span></dt><dt><span class="section"><a href="jetty-xml-usage.html">Jetty XML Usage</a></span></dt><dt><span class="section"><a href="jetty-xml-config.html">jetty.xml</a></span></dt><dt><span class="section"><a href="jetty-web-xml-config.html">jetty-web.xml</a></span></dt><dt><span class="section"><a href="jetty-env-xml.html">jetty-env.xml</a></span></dt><dt><span class="section"><a href="webdefault-xml.html">webdefault.xml</a></span></dt><dt><span class="section"><a href="override-web-xml.html">Jetty override-web.xml</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="jetty-xml-syntax"></a>Jetty XML Syntax</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="reference-section.html#basic-xml-configuration-file-example">Basic XML Configuration File Example</a></span></dt><dt><span class="section"><a href="reference-section.html#_overview_2">Overview</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-configure">&lt;Configure&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-set">&lt;Set&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-get">&lt;Get&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-put">&lt;Put&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-call">&lt;Call&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-arg">&lt;Arg&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-new">&lt;New&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-ref">&lt;Ref&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-array">&lt;Array&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-item">&lt;Item&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-map">&lt;Map&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-entry">&lt;Entry&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-system-property">&lt;SystemProperty&gt;</a></span></dt><dt><span class="section"><a href="reference-section.html#jetty-xml-property">&lt;Property&gt;</a></span></dt></dl></div><p>The Jetty XML syntax is a straightforward mapping of XML elements to a Java API so that POJOs can be instantiated and getters, setters, and methods called.
It is very similar to Inversion Of Control (IOC) or Dependency Injection (DI) frameworks like Spring or Plexus (but it predates all of them).
Typically Jetty XML is used by <code class="literal">jetty.xml</code> to configure a Jetty server or by a <code class="literal">context.xml</code> file to configure a ContextHandler or subclass, but you can also use the mechanism to configure arbitrary POJOs.</p><p>This page describes the basic syntax of Jetty XML configuration. See <a class="xref" href="jetty-xml-usage.html" title="Jetty XML Usage">Jetty XML Usage</a> for information on how you can use and combine Jetty XML.
See configuration files for specific examples.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="basic-xml-configuration-file-example"></a>Basic XML Configuration File Example</h3></div></div></div><p>The following XML configuration file creates some Java objects and sets some attributes:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"&gt;
&lt;Configure id="foo" class="com.acme.Foo"&gt;
&lt;Set name="name"&gt;demo&lt;/Set&gt;
&lt;Set name="nested"&gt;
&lt;New id="bar" class="com.acme.Bar"&gt;
&lt;Arg&gt;true&lt;/Arg&gt;
&lt;Set name="wibble"&gt;10&lt;/Set&gt;
&lt;Set name="wobble"&gt;xyz&lt;/Set&gt;
&lt;Set name="parent"&gt;&lt;Ref refid="foo"/&gt;&lt;/Set&gt;
&lt;Call name="init"&gt;
&lt;Arg&gt;false&lt;/Arg&gt;
&lt;/Call&gt;
&lt;/New&gt;
&lt;/Set&gt;
&lt;Ref refid="bar"&gt;
&lt;Set name="wibble"&gt;20&lt;/Set&gt;
&lt;Get name="parent"&gt;
&lt;Set name="name"&gt;demo2&lt;/Set&gt;
&lt;/Get&gt;
&lt;/Ref&gt;
&lt;/Configure&gt;</code></pre><p>The XML above is equivalent to the following Java code:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>com.acme.Foo foo = new com.acme.Foo();
foo.setName("demo");
com.acme.Bar bar = new com.acme.Bar(true);
bar.setWibble(10);
bar.setWobble("xyz");
bar.setParent(foo);
bar.init(false);
foo.setNested(bar);
bar.setWibble(20);
bar.getParent().setName("demo2");</code></pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="_overview_2"></a>Overview</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="jetty-xml-dtd"></a>Understanding DTD and Parsing</h4></div></div></div><p>The document type descriptor
(<a class="link" href="https://github.com/eclipse/jetty.project/tree/jetty-9.4.x/jetty-xml/src/main/resources/org/eclipse/jetty/xml/configure_9_0.dtd?h=release-9" target="_top">configure.dtd</a>) describes all valid elements in a Jetty XML configuration file using the Jetty IoC format.
The first two lines of an XML must reference the DTD to be used to validate the XML like:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"&gt;
...</code></pre><p>Typcically a good XML editor will fetch the DTD from the URL and use it to give syntax highlighting and validation while a configuration file is being edited.
Some editors also allows DTD files to be locally cached.
The URL may point to configure.dtd if you want the latest current version, or to a specific version like configure_9_3.dtd if you want a particular validation feature set.</p><p>Files that conform to the configure.dtd format are processed in Jetty by the <code class="literal">XmlConfiguration</code> class which may also validate the XML (using a version of the DTD from the classes jar file), but is by default run in a forgiving mode that tries to work around validation failures.</p><p>To ensure your <code class="literal">web.xml</code>, <code class="literal">web-fragment.xml</code> and <code class="literal">webdefault.xml</code> files are validated, you will also need to set the <code class="literal">validateXml</code> attribute to true:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Call name="setAttribute"&gt;
&lt;Arg&gt;org.eclipse.jetty.webapp.validateXml&lt;/Arg&gt;
&lt;Arg type="Boolean"&gt;true&lt;/Arg&gt;
&lt;/Call&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_jetty_xml_configuration_scope"></a>Jetty XML Configuration Scope</h4></div></div></div><p>The configuration of object instances with Jetty IoC XML is done on a scoped basis, so that for any given XML element there is a corresponding Object in scope and the nested XML elements apply to that.
The outer most scope is given by a Configure element and elements like Call, New and Get establish new scopes.
The following example uses the name fields to explain the scope.</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure class="com.example.Foo"&gt;
&lt;Set name="fieldOnFoo"&gt;value&lt;/Set&gt;
&lt;Set name="fieldOnFoo"&gt;
&lt;New class="com.example.Bar"&gt;
&lt;Set name=fieldOnBar&gt;value&lt;/Set&gt;
&lt;Call name="methodOnBarWithNoArgs"/&gt;
&lt;/New&gt;
&lt;/Set&gt;
&lt;Call name="methodOnFoo"&gt;
&lt;Arg&gt;value for first arg of methodOnFoo&lt;/Arg&gt;
&lt;Arg&gt;&lt;New class="com.example.Bar"/&gt;&lt;/Arg&gt;
&lt;Set name="fieldOnObjectReturnedByMethodOnFoo"&gt;value&lt;/Set&gt;
&lt;Call name="methodOnObjectReturnedByMethodOnFooWithNoArgs"/&gt;
&lt;/Call&gt;
&lt;/Configure&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_coercing_arguments_to_a_type"></a>Coercing Arguments to a Type</h4></div></div></div><p>When trying to match XML elements to java elements, Jetty <code class="literal">XmlConfiguration</code> may need to coerces values to match method arguments.
By default it does so on a best effort basis, but you can also specify explicit types with the <code class="literal">type</code> attribute.
Supported values for type are: <code class="literal">String</code>, <code class="literal">Character</code>, <code class="literal">Short</code>, <code class="literal">Byte</code>, <code class="literal">Integer</code>, <code class="literal">Long</code>, <code class="literal">Boolean</code>, <code class="literal">Float</code>, <code class="literal">Double</code>, <code class="literal">char</code>, <code class="literal">short</code>, <code class="literal">byte</code>, <code class="literal">int</code>, <code class="literal">long</code>, <code class="literal">boolean</code>, <code class="literal">float</code>, <code class="literal">double</code>, <code class="literal">URL</code>, <code class="literal">InetAddress</code>, <code class="literal">InetAddrPort</code>, and <code class="literal">void</code>.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_referring_to_a_class"></a>Referring to a Class</h4></div></div></div><p>If you do not specify the classname, Jetty assumes you are calling the method on the object that is current in scope (eg the object of the surrounding <code class="literal">Configure</code>, <code class="literal">New</code> or <code class="literal">Get</code> clause).
If the class attribute is specified to a fully-qualified class name, then it is either used to create a new instance (<code class="literal">Configure</code> and <code class="literal">New</code> elements) or is used to access a static (<code class="literal">Call</code>, <code class="literal">Set</code> or <code class="literal">Get</code> elements).</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_referring_to_an_object"></a>Referring to an Object</h4></div></div></div><p>You can use the id attribute to store a reference to the current object when first creating or referring to this object.
You can then use the <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref element</a> to reference the object later.
The ID must be unique for each object you create.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_attribute_vs_element_style"></a>Attribute vs Element Style</h4></div></div></div><p>For XML elements that contain only other XML Elements, there is a choice of using attributes or elements style.
The following is an example of attribute style:</p><pre class="literallayout"> &lt;Call id="result" class="org.example.SomeClass" name="someMethod" arg="value0,value1"/&gt;</pre><p>Attribute style has the benefit of brevity, but is limited by: values can only be Strings; multivalued items can not contain <span class="emphasis"><em>,</em></span>; values may not be subject to property expansion or other elements that return values.
Thus, the more verbose element style is available and the following is semantically equivalent to the attribute style above:</p><pre class="literallayout"> &lt;Call&gt;
&lt;Id&gt;result&lt;/Id&gt;
&lt;Class&gt;org.example.SomeClass&lt;/Class&gt;
&lt;Name&gt;someMethod&lt;/Name&gt;
&lt;Arg&gt;value0&lt;/Arg&gt;
&lt;Arg&gt;value1&lt;/Arg&gt;
&lt;/Call&gt;</pre><p>Note that multivalued elements like <code class="literal">Arg</code> must be repeated and may not be comma-separated like they are when provided as attributes.
It is possible to use a mix of styles and the following example shows a moretypical example that uses property expansion as the reason for element style:</p><pre class="literallayout"> &lt;Call id="result" name="someMethod"&gt;
&lt;Class&gt;&lt;Property name="which.class"&gt;
&lt;Default&gt;&lt;Property name="default.class" default="org.example.SomeClass"/&gt;
&lt;/Property&gt;&lt;/Class&gt;
&lt;Arg&gt;value0&lt;/Arg&gt;
&lt;Arg&gt;value1&lt;/Arg&gt;
&lt;/Call&gt;</pre><p>Attributes may not be expressed as elements when their parent element is one that contains data.
Thus <code class="literal">Arg</code>, <code class="literal">Item</code>, <code class="literal">Set</code>, <code class="literal">Put</code> and <code class="literal">Get</code> elements may not have their attributes expressed as elements.</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-configure"></a>&lt;Configure&gt;</h3></div></div></div><p>This is the root element that specifies the class of object that is to be configured.
It is usually either the Server, in <code class="literal">jetty.xml</code>, or a <code class="literal">WebAppContext</code> in <code class="literal">jetty-web.xml</code>.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>A reference to the object that was created. If you define
multiple <a class="link" href="reference-section.html#jetty-xml-configure" title="<Configure&gt;">Configure element</a>s with the same id,
they will be treated as one object, even if they&#8217;re in different files.
You can use this to break up configuration of an object (such as the
Server) across multiple files.</p></td></tr><tr><td align="left" valign="top"><p>class</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>The fully qualified classname of the object to be
configured. Could be <code class="literal">org.eclipse.jetty.server.Server</code>,
<code class="literal">org.eclipse.jetty.webapp.WebAppContext</code>, a handler, etc.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-set" title="<Set&gt;">Set element</a>, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>,
<a class="link" href="reference-section.html#jetty-xml-put" title="<Put&gt;">Put element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call element</a>,
<a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref element</a>,
<a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_2"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_example"></a>Basic Example</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure class="org.eclipse.jetty.server.Server"&gt;
&lt;Set name="port"&gt;8080&lt;/Set&gt;
&lt;/Configure&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server();
server.setPort(8080);</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_using_id_to_break_up_configuration_of_one_object_across_multiple_files"></a>Using id to break up configuration of one object across multiple files</h5></div></div></div><p>In <code class="literal">etc/jetty.xml</code>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
&lt;!-- basic configuration here --&gt;
&lt;/Configure&gt;</code></pre><p>In <code class="literal">etc/jetty-logging.xml</code>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
&lt;!-- assumes that you have the basic server configuration set up; this file only contains additional configuration for logging --&gt;
&lt;/Configure&gt;</code></pre><p>Then run the combined configuration using:</p><pre class="literallayout">java -jar start.jar etc/jetty.xml jetty-logging.xml</pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-set"></a>&lt;Set&gt;</h3></div></div></div><p>A Set element maps to a call to a setter method or field on the current object.
It can contain text and/or elements such as <code class="literal">Call</code>, <code class="literal">New</code>, <code class="literal">SystemProperty</code>, etc., as values.
The name and optional type attributes are used to select the setter method.
If you do not specify a value type, white space is trimmed out of the value.
If it contains multiple elements as values, they are added as strings before being converted to any specified type.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>name</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>the name of the setter method to call, or the field to set.
If the name given is xxx, then a setXxx method is used. If the setXxx
method cannot be found, then the xxx field is used.</p></td></tr><tr><td align="left" valign="top"><p>type</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>the declared type of the argument. See also discussion of
type for Arg for how to define null and empty string values.</p></td></tr><tr><td align="left" valign="top"><p>class</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>if present, then this Set is treated as a static set method
invocation</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_2"></a>Can Contain</h4></div></div></div><p>value text, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call
element</a>, <a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref
element</a>, <a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map
element</a>, <a class="link" href="reference-section.html#jetty-xml-system-property" title="<SystemProperty&gt;">System Property element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_3"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_example_2"></a>Basic Example</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Set name="port"&gt;8080&lt;/Set&gt;
&lt;/Configure&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_set_via_a_system_property"></a>Set via a System Property</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Set name="port"&gt;&lt;SystemProperty name="jetty.http.port" /&gt;&lt;/Set&gt;
&lt;/Configure&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_creating_a_newobject_and_setting_it_on_the_server"></a>Creating a NewObject and Setting It on the Server</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Set name="threadPool"&gt;
&lt;New class="org.eclipse.jetty.util.thread.QueuedThreadPool"&gt;
&lt;Set name="minThreads"&gt;10&lt;/Set&gt;
&lt;Set name="maxThreads"&gt;1000&lt;/Set&gt;
&lt;/New&gt;
&lt;/Set&gt;
&lt;/Configure&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server();
org.eclipse.jetty.util.thread.QueuedThreadPool threadPool = new org.eclipse.jetty.util.thread.QueuedThreadPool();
threadPool.setMinThreads(10);
threadPool.setMaxThreads(1000);
server.setThreadPool(threadPool);</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_invoking_a_static_setter"></a>Invoking a Static Setter</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Set class="org.eclipse.jetty.util.log.Log" name="logToParent"&gt;loggerName&lt;/Set&gt;
&lt;/Configure&gt;</code></pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-get"></a>&lt;Get&gt;</h3></div></div></div><p>A Get element maps to a call to a getter method or field on the current object.
It can contain nested elements such as <code class="literal">Set</code>, <code class="literal">Put</code>, <code class="literal">Call</code>, etc.; these act on the object returned by the <code class="literal">Get</code> call.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>name</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>the name of the getter method to call, or the field to get.
If the name given is xxx, then a getXxx method is used. If the getXxx
method cannot be found, then the xxx field is used.</p></td></tr><tr><td align="left" valign="top"><p>class</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>f present, then this Get is treated as a static getter or
field.</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>if present, then you can use this id to refer to the returned
object later.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_3"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-set" title="<Set&gt;">Set element</a>, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>,
<a class="link" href="reference-section.html#jetty-xml-put" title="<Put&gt;">Put element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call element</a>,
<a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref element</a>,
<a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_4"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_example_3"></a>Basic Example</h5></div></div></div><p>This simple example doesn&#8217;t do much on its own.
You would normally use this in conjunction with a <code class="literal">&lt;Ref id="Logger" /&gt;</code>.</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Get id="Logger" class="org.eclipse.jetty.util.log.Log" name="log"/&gt;
&lt;/Configure&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_invoking_a_static_getter_and_call_methods_on_the_returned_object"></a>Invoking a Static Getter and Call Methods on the Returned Object</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Get class="java.lang.System" name="out"&gt;
&lt;Call name="println"&gt;
&lt;Arg&gt;Server version is: &lt;Get class="org.eclipse.jetty.server.Server" name="version"/&gt;&lt;/Arg&gt;
&lt;/Call&gt;
&lt;/Get&gt;
&lt;/Configure&gt;</code></pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-put"></a>&lt;Put&gt;</h3></div></div></div><p>A Put element maps to a call to a put method on the current object, which must implement the Map interface.
It can contain text and/or elements such as <code class="literal">Call</code>, <code class="literal">New</code>, <code class="literal">SystemProperty</code>, etc. as values.
If you do not specify a no value type, white space is trimmed out of the value.
If it contains multiple elements as values, they are added as strings before being converted to any specified type.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>name</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>used as the put key</p></td></tr><tr><td align="left" valign="top"><p>type</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>forces the type of the value. See also discussion of type for
Arg for how to define null and empty string values.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_4"></a>Can Contain</h4></div></div></div><p>value text, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call
element</a>, <a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref
element</a>, <a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map
element</a>, <a class="link" href="reference-section.html#jetty-xml-system-property" title="<SystemProperty&gt;">System Property element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_example_2"></a>Example</h4></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Get name="someKindOfMap"&gt;
&lt;Put name="keyName"&gt;objectValue&lt;/Put&gt;
&lt;/Get&gt;</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-call"></a>&lt;Call&gt;</h3></div></div></div><p>A <code class="literal">Call</code> element maps to an arbitrary call to a method on the current object.
It can contain a sequence of Arg elements followed by a sequence of configuration elements, such as Set, Put, Call.
The &lt;Arg&gt;s are passed as arguments to the method; the sequence of configuration elements act on the object returned by the original call.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>name</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>the name of the arbitrary method to call. The method called
will use the exact name you provide it.</p></td></tr><tr><td align="left" valign="top"><p>class</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>if present, then this Call is treated as a static method.</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>if present, you can use this id to refer to any object returned
by the call, for later use.</p></td></tr><tr><td align="left" valign="top"><p>arg</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>comma separated list of arguments may be used for simple
string values rather than Arg elements</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_5"></a>Can Contain</h4></div></div></div><p>Attributes as elements (Id, Name, Class) plus <a class="link" href="reference-section.html#jetty-xml-arg" title="<Arg&gt;">Arg
element</a>, <a class="link" href="reference-section.html#jetty-xml-set" title="<Set&gt;">Set element</a>, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get
element</a>, <a class="link" href="reference-section.html#jetty-xml-put" title="<Put&gt;">Put element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call
element</a>, <a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref
element</a>, <a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map
element</a>, <a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_5"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_example_4"></a>Basic example</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Call name="doFoo"&gt;
&lt;Arg&gt;bar&lt;/Arg&gt;
&lt;Set name="test"&gt;1, 2, 3&lt;/Set&gt;
&lt;/Call&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>Object o2 = o1.doFoo("bar");
o2.setTest("1, 2, 3");</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_invoking_a_static_method"></a>Invoking a static method</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Call class="com.acme.Foo" name="setString"&gt;
&lt;Arg&gt;somestring&lt;/Arg&gt;
&lt;/Call&gt;</code></pre><p>Which is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>com.acme.Foo.setString("somestring");</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_invoking_the_actual_methodinstead_of_relying_on_getter_setter_magic"></a>Invoking the Actual MethodInstead of Relying on Getter/Setter Magic</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Call name="getPort" id="port" /&gt;
&lt;Call class="com.acme.Environment" name="setPort"&gt;
&lt;Arg&gt;
&lt;Ref refid="port"/&gt;
&lt;/Arg&gt;
&lt;/Call&gt;
&lt;/Configure&gt;</code></pre><p>Which is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>org.mortbay.jetty.Server server = new org.mortbay.jetty.Server();
com.acme.Environment.setPort( server.getPort() );</code></pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-arg"></a>&lt;Arg&gt;</h3></div></div></div><p>An Arg element can be an argument of either a method or a constructor.
Use it within <a class="link" href="">] and xref:jetty-syntax-new[</a>.</p><p>It can contain text and/or elements, such as <code class="literal">Call</code>, <code class="literal">New</code>, <code class="literal">SystemProperty</code>, etc., as values.
The optional type attribute can force the type of the value.
If you don&#8217;t specify a type, white space is trimmed out of the value.
If it contains multiple elements as values, they are added as strings before being converted to any specified type.
Simple <code class="literal">String</code> arguments can also be specified as a string separated arg attribute on the parent element.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>type</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>force the type of the argument. If you do not provide a value
for the element, if you use type of "String", the value will be the
empty string (""), otherwise it is null.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_6"></a>Can Contain</h4></div></div></div><p>value text, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call
element</a>, <a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref
element</a>, <a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map
element</a>, <a class="link" href="reference-section.html#jetty-xml-system-property" title="<SystemProperty&gt;">System Property element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_6"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_examples"></a>Basic examples</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Arg&gt;foo&lt;/Arg&gt; &lt;!-- String --&gt;
&lt;Arg&gt;true&lt;/Arg&gt; &lt;!-- Boolean --&gt;
&lt;Arg&gt;1&lt;/Arg&gt; &lt;!-- int, long, short, float, double --&gt;
&lt;Arg&gt;&lt;Ref refid="foo" /&gt;&lt;/Arg&gt; &lt;!-- any object; reference a previously created object with id "foo", and pass it as a parameter --&gt;
&lt;Arg&gt;&lt;/Arg&gt; &lt;!-- null value --&gt;
&lt;Arg type="String"&gt;&lt;/Arg&gt; &lt;!-- empty string "" --&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_coercing_type"></a>Coercing Type</h5></div></div></div><p>This explicitly coerces the type to a boolean:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Arg type="boolean"&gt;False&lt;/Arg&gt;</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_as_a_parameter"></a>As a Parameter</h5></div></div></div><p>Here are a couple of examples of <a class="link" href="reference-section.html#jetty-xml-arg" title="<Arg&gt;">Arg element</a> being used as a parameter to methods and to constructors:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Call class="com.acme.Environment" name="setFoo"&gt;
&lt;Arg&gt;
&lt;New class="com.acme.Foo"&gt;
&lt;Arg&gt;bar&lt;/Arg&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/Call&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>com.acme.Environment.setFoo(new com.acme.Foo("bar"));</code></pre><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;New class="com.acme.Baz"&gt;
&lt;Arg&gt;
&lt;Call id="bar" class="com.acme.MyStaticObjectFactory" name="createObject"&gt;
&lt;Arg&gt;2&lt;/Arg&gt;
&lt;/Call&gt;
&lt;/Arg&gt;
&lt;/New&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>new com.acme.Baz(com.acme.MyStaticObjectFactory.createObject(2));</code></pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-new"></a>&lt;New&gt;</h3></div></div></div><p>Instantiates an object.
Equivalent to <code class="literal">new</code> in Java, and allows the creation of a new object.
A <code class="literal">New</code> element can contain a sequence of <a class="link" href="reference-section.html#jetty-xml-arg" title="<Arg&gt;"><code class="literal">Arg</code> element</a>'s, followed by a sequence of configuration elements (<code class="literal">Set</code>, <code class="literal">Put</code>, etc).
<a class="link" href="reference-section.html#jetty-xml-arg" title="<Arg&gt;"><code class="literal">Arg</code> element</a>'s are used to select a constructor for the object to be created.
The sequence of configuration elements then acts on the newly-created object.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>class</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>fully qualified classname, which determines the type of the
new object that is instantiated.</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>gives a unique name to the object which can be referenced later
by Ref elements.</p></td></tr><tr><td align="left" valign="top"><p>arg</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>comma separated list of arguments may be used for simple
string values rather than Arg elements</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_7"></a>Can Contain</h4></div></div></div><p>Attributes as elements (Id, Class) plus <a class="link" href="reference-section.html#jetty-xml-arg" title="<Arg&gt;">Arg
element</a>, <a class="link" href="reference-section.html#jetty-xml-set" title="<Set&gt;">Set element</a>, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get
element</a>, <a class="link" href="reference-section.html#jetty-xml-put" title="<Put&gt;">Put element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call
element</a>, <a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref
element</a>, <a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map
element</a>, <a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_7"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_example_5"></a>Basic example</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;New class="com.acme.Foo"&gt;
&lt;Arg&gt;bar&lt;/Arg&gt;
&lt;/New&gt;</code></pre><p>Which is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>com.acme.Foo foo = new com.acme.Foo("bar");</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_instantiate_with_the_default_constructor"></a>Instantiate with the Default Constructor</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;New class="com.acme.Foo" /&gt;</code></pre><p>Which is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>com.acme.Foo foo = new com.acme.Foo();</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_instantiate_with_multiple_arguments_then_configuring_further"></a>Instantiate with Multiple Arguments, Then Configuring Further</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;New id="foo" class="com.acme.Foo"&gt;
&lt;Arg&gt;bar&lt;/Arg&gt;
&lt;Arg&gt;baz&lt;/Arg&gt;
&lt;Set name="test"&gt;1, 2, 3&lt;/Set&gt;
&lt;/New&gt;</code></pre><p>Which is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>Object foo = new com.acme.Foo("bar", "baz");
foo.setTest("1, 2, 3");</code></pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-ref"></a>&lt;Ref&gt;</h3></div></div></div><p>A <code class="literal">Ref</code> element allows a previously created object to be referenced by a unique id.
It can contain a sequence of elements, such as <code class="literal">Set</code> or <code class="literal">Put</code> which then act on the referenced object.
You can also use a <code class="literal">Ref</code> element as a value for other elements such as <code class="literal">Set</code> and <code class="literal">Arg</code>.</p><p>The <code class="literal">Ref</code> element provides convenience and eases readability.
You can usually achieve the effect of the <code class="literal">Ref</code> by nesting elements (method calls), but this can get complicated very easily.
The Ref element makes it possible to refer to the same object if you&#8217;re using it multiple times, or passing it into multiple methods.
It also makes it possible to split up configuration across multiple files.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>refid</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>the unique identifier used to name a previously created
object.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_8"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-set" title="<Set&gt;">Set element</a>, <a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>,
<a class="link" href="reference-section.html#jetty-xml-put" title="<Put&gt;">Put element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call element</a>,
<a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref element</a>,
<a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_examples_8"></a>Examples</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_basic_example_6"></a>Basic example</h5></div></div></div><p>Use the referenced object as an argument to a method call or constructor:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Get id="foo" name="xFoo" /&gt;
&lt;Set name="test"&gt;&lt;Ref refid="foo"/&gt;&lt;/Set&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>foo = getXFoo();
setSomeMethod(foo);</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_manipulating_the_object_returned_by_ref"></a>Manipulating the Object Returned by Ref</h5></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Get id="foo" name="xFoo" /&gt;
&lt;Ref refid="foo"&gt;
&lt;Set name="test"&gt;1, 2, 3&lt;/Set&gt;
&lt;/Ref&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>foo = getXFoo();
foo.setTest("1, 2, 3");</code></pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_ref_vs_nested_elements"></a>Ref vs. Nested Elements</h5></div></div></div><p>Here is an example of the difference in syntax between using the <code class="literal">Ref</code> element, and nesting method calls.
They are exactly equivalent:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;!-- using Ref in conjunction with Get --&gt;
&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Get id="Logger" class="org.eclipse.jetty.util.log.Log" name="log"/&gt;
&lt;Ref refid="Logger"&gt;
&lt;Set name="debugEnabled"&gt;true&lt;/Set&gt;
&lt;/Ref&gt;
&lt;/Configure&gt;
&lt;!-- calling the setter directly on the object returned by Get --&gt;
&lt;Configure id="Server" class="org.eclipse.jetty.server.Server"&gt;
&lt;Get class="org.eclipse.jetty.util.log.Log" name="log"&gt;
&lt;Set name="debugEnabled"&gt;true&lt;/Set&gt;
&lt;/Get&gt;
&lt;/Configure&gt;</code></pre><p>Here is a more practical example, taken from the handler configuration section in <code class="literal">etc/jetty.xml</code>:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Set name="handler"&gt;
&lt;New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"&gt;
&lt;Set name="handlers"&gt;
&lt;Array type="org.eclipse.jetty.server.Handler"&gt;
&lt;Item&gt;
&lt;!-- create a new instance of a ContextHandlerCollection named "Contexts" --&gt;
&lt;New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/&gt;
&lt;/Item&gt;
&lt;Item&gt;
&lt;New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/&gt;
&lt;/Item&gt;
&lt;Item&gt;
&lt;!-- create a new instance of a RequestLogHandler named "RequestLog" --&gt;
&lt;New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/&gt;
&lt;/Item&gt;
&lt;/Array&gt;
&lt;/Set&gt;
&lt;/New&gt;
&lt;/Set&gt;
&lt;Call name="addBean"&gt;
&lt;Arg&gt;
&lt;New class="org.eclipse.jetty.deploy.ContextDeployer"&gt;
&lt;!-- pass in the ContextHandlerCollection object ("Contexts") that was created earlier, as an argument --&gt;
&lt;Set name="contexts"&gt;&lt;Ref refid="Contexts"/&gt;&lt;/Set&gt;
&lt;/New&gt;
&lt;/Arg&gt;
&lt;/Call&gt;
&lt;!-- configure the RequestLogHandler object ("RequestLog") that we created earlier --&gt;
&lt;Ref refid="RequestLog"&gt;
....
&lt;/Ref&gt;</code></pre></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-array"></a>&lt;Array&gt;</h3></div></div></div><p>An <code class="literal">Array</code> element allows the creation of a new array.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>type</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>specify what types of items the array can contain.</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>unique identifier you can use to refer to the array later.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_9"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-item" title="<Item&gt;">Item element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_example_3"></a>Example</h4></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Array type="java.lang.String"&gt;
&lt;Item&gt;value0&lt;/Item&gt;
&lt;Item&gt;&lt;New class="java.lang.String"&gt;&lt;Arg&gt;value1&lt;/Arg&gt;&lt;/New&gt;&lt;/Item&gt;
&lt;/Array&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>String[] a = new String[] { "value0", new String("value1") };</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-item"></a>&lt;Item&gt;</h3></div></div></div><p>An <code class="literal">Item</code> element defines an entry for Array and Map elements.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>type</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>force the types of value.</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>unique identifier that you can use to refer to the array later.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_10"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-get" title="<Get&gt;">Get element</a>, <a class="link" href="reference-section.html#jetty-xml-call" title="<Call&gt;">Call element</a>,
<a class="link" href="reference-section.html#jetty-xml-new" title="<New&gt;">New element</a>, <a class="link" href="reference-section.html#jetty-xml-ref" title="<Ref&gt;">Ref element</a>,
<a class="link" href="reference-section.html#jetty-xml-array" title="<Array&gt;">Array element</a>, <a class="link" href="reference-section.html#jetty-xml-map" title="<Map&gt;">Map element</a>,
<a class="link" href="reference-section.html#jetty-xml-system-property" title="<SystemProperty&gt;">System Property element</a>,
<a class="link" href="reference-section.html#jetty-xml-property" title="<Property&gt;">Property element</a></p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-map"></a>&lt;Map&gt;</h3></div></div></div><p>A <code class="literal">Map</code> element allows the creation of a new HashMap and to populate it with <code class="literal">(key, value)</code> pairs.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>unique identifier you can use to refer to the map later.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_11"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-entry" title="<Entry&gt;">Entry element</a></p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_example_4"></a>Example</h4></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Map&gt;
&lt;Entry&gt;
&lt;Item&gt;keyName&lt;/Item&gt;
&lt;Item&gt;&lt;New class="java.lang.String"&gt;&lt;Arg&gt;value1&lt;/Arg&gt;&lt;/New&gt;&lt;/Item&gt;
&lt;/Entry&gt;
&lt;/Map&gt;</code></pre><p>This is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>Map m = new HashMap();
m.put("keyName", new String("value1"));</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-entry"></a>&lt;Entry&gt;</h3></div></div></div><p>An <code class="literal">Entry</code> element contains a key-value <a class="link" href="reference-section.html#jetty-xml-item" title="<Item&gt;">Item element</a> pair for a <code class="literal">Map</code>.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_12"></a>Can Contain</h4></div></div></div><p><a class="link" href="reference-section.html#jetty-xml-item" title="<Item&gt;">Item element</a></p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-system-property"></a>&lt;SystemProperty&gt;</h3></div></div></div><p>A <code class="literal">SystemProperty</code> element gets the value of a JVM system property.
It can be used within elements that accept values, such as <code class="literal">Set</code>, <code class="literal">Put</code>, <code class="literal">Arg</code>.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>name</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>property name</p></td></tr><tr><td align="left" valign="top"><p>default</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>a default value as a fallback</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>unique identifier which you can use to refer to the array
later.</p></td></tr></tbody></table></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_13"></a>Can Contain</h4></div></div></div><p>Only attributes as Elements (<code class="literal">Id</code>, <code class="literal">Name</code>, <code class="literal">Default</code>).</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_example_5"></a>Example</h4></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;SystemProperty name="jetty.http.port" default="8080"/&gt;</code></pre><p>That is equivalent to:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>System.getProperty("jetty.http.port", "8080");</code></pre><p>Both try to retrieve the value of <code class="literal">jetty.http.port</code>.
If <code class="literal">jetty.http.port</code> is not set, then 8080 is used.</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="jetty-xml-property"></a>&lt;Property&gt;</h3></div></div></div><p>A <code class="literal">Property</code> element allows arbitrary properties to be retrieved by name.
It can contain a sequence of elements, such as <code class="literal">Set</code>, <code class="literal">Put</code>, <code class="literal">Call</code> that act on the retrieved object.</p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"></colgroup><thead><tr><th align="left" valign="top">Attribute</th><th align="left" valign="top">Required</th><th align="left" valign="top">Description</th></tr></thead><tbody><tr><td align="left" valign="top"><p>name</p></td><td align="left" valign="top"><p>yes</p></td><td align="left" valign="top"><p>property name</p></td></tr><tr><td align="left" valign="top"><p>default</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>a default value as a fallback</p></td></tr><tr><td align="left" valign="top"><p>id</p></td><td align="left" valign="top"><p>no</p></td><td align="left" valign="top"><p>unique identifier which you can use to refer to the array
later.</p></td></tr></tbody></table></div><p>The <code class="literal">Name</code> attribute may be a comma separated list of property names, with the first property name being the "official" name, and the others names being old, deprecated property names that are kept for backward compatibility.
A warning log is issued when deprecated property names are used.
The <code class="literal">Default</code> attribute contains the value to use in case none of the property names is found.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_can_contain_14"></a>Can Contain</h4></div></div></div><p>The attributes may be expressed as contained Elements (<code class="literal">Id</code>, <code class="literal">Name</code>, <code class="literal">Default</code>).</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_example_6"></a>Example</h4></div></div></div><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;Property name="Server"&gt;
&lt;Call id="jdbcIdMgr" name="getAttribute"&gt;
&lt;Arg&gt;jdbcIdMgr&lt;/Arg&gt;
&lt;/Call&gt;
&lt;/Property&gt;</code></pre></div></div></div></div><script type="text/javascript">
SyntaxHighlighter.all()
</script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ubuntu.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="jetty-ref-guide.html"><i class="fa fa-chevron-up" aria-hidden="true"></i> Top</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="jetty-xml-usage.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Ubuntu&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></td><td width="40%" align="right" valign="top">&nbsp;Jetty XML Usage</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout">
See an error or something missing?
<span class="callout"><a href="http://github.com/eclipse/jetty.project">Contribute to this documentation at
<span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2020-03-10)</i></span></div></p></body></html>