Skip to content

Commit e2c3669

Browse files
committed
some more configuration
1 parent 1c9ed62 commit e2c3669

File tree

3 files changed

+63
-24
lines changed

3 files changed

+63
-24
lines changed

src/docbkx/quick-start/configuring/how-to-configure.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclud
77
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"
88
xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/docbook">
99
<title xml:id="intro-jetty-configuration-how">How to Configure Jetty</title>
10-
<para>To understand Jetty Configuration, you need to understand the "How" - what configuration mechanisms exist; and
11-
"What" the actual objects and fields that can be configured with those mechanisms.</para>
10+
<para>To understand Jetty Configuration, you need to understand the "How" and the "What". This section covers how to
11+
configure Jetty in terms of what mechanisms exist to perform configuration. The <link
12+
linkend="quickstart-what-to-configure">next section</link> will give an overview of the action components and fields
13+
that can be configured with these mechanisms.</para>
1214
<section>
1315
<title>Jetty POJO Configuration</title>
1416
<para>The main components of Jetty are simply Plain Old Java Objects ( <link
@@ -98,7 +100,7 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
98100
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ExampleServer.java</filename>
99101
</programlisting>
100102
<para>The exact same server configuration can be achieve with the Jetty XML file:</para>
101-
<programlisting>
103+
<programlisting language="fetch">
102104
<filename>
103105
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/examples/embedded/src/main/resources/exampleserver.xml</filename>
104106
</programlisting>

src/docbkx/quick-start/configuring/what-to-configure.xml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclud
77
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"
88
xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/docbook">
99
<title>What to Configure in Jetty</title>
10-
<para>This section gives an overview of the what components of Jetty typically configured using the mechanisms
11-
outline in the previous section. The structure of a Jetty server is described in <xref
12-
linkend="basic-architecture" />which is good background reading to understand configuration and is vital to if you
13-
wish to change the structure of the server as set up by the default configurations in the jetty distribution.
14-
However, for most purposes, configuration is a matter of identifying the correct configuration file and modifying
15-
existing configuration values.</para>
10+
<para>This section gives an overview of the what components of Jetty can be configured, using the mechanisms outline
11+
in the <link linkend="quickstart-how-to-configure">previous section</link>. The structure of a Jetty server is
12+
described in the <link linkend="architecture">architecture section</link>, which is good background reading to
13+
understand configuration and is vital to if you wish to change the structure of the server as set up by the default
14+
configurations in the jetty distribution. However, for most purposes, configuration is a matter of identifying the
15+
correct configuration file and modifying existing configuration values.</para>
1616
<section>
1717
<title xml:id="intro-jetty-configuration-server">Configuring the Server</title>
1818
<para>The Server instance is the central coordination object of a Jetty server and it provides services and life
@@ -58,6 +58,23 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
5858
among other things, the sending of Dates and Versions in HTTP responses.</para>
5959
</listitem>
6060
</varlistentry>
61+
<varlistentry>
62+
<term>Connectors</term>
63+
<listitem>
64+
<para>It is the server that holds a collection of Connectors used to receive connections for HTTP and the
65+
other protocols that Jetty supports. Configuration of the connectors themselves is described in the next
66+
section. For the server you can either set the collection of all connectors or add/remove individual
67+
connectors.</para>
68+
</listitem>
69+
</varlistentry>
70+
<varlistentry>
71+
<term>Services</term>
72+
<listitem>
73+
<para>The server can hold additional service object, sometimes as attributes, but often as aggregated
74+
LifeCycle bean. Examples of services are Login Services and DataSources, which are configured at the server
75+
level and then injected into the web applications that use them.</para>
76+
</listitem>
77+
</varlistentry>
6178
</variablelist>
6279
</section>
6380
<section>
@@ -124,8 +141,8 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
124141
<para>A jetty context is a Handler that groups other Handlers under a context path together with associated
125142
resources and is roughly equivalent to the standard ServletContext API. A context may contain either standard jetty
126143
handlers or a custom application handler. Standard web applications based on the servlet specification are contexts
127-
that include standard handlers for sessions, security and servlets, and are configured by using a standard
128-
web.xml.</para>
144+
that include standard handlers for sessions, security and servlets, and are configured by using a standard web.xml
145+
and often need little or no additional configuration.</para>
129146
<para>Configuration values that are common to all contexts are:</para>
130147
<variablelist>
131148
<varlistentry>
@@ -172,9 +189,11 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
172189
</listitem>
173190
</varlistentry>
174191
<varlistentry>
175-
<term>resouceBase</term>
192+
<term>resourceBase</term>
176193
<listitem>
177-
<para />
194+
<para>The resource base is a directory (or collection of directories or URL) that contains the static
195+
resources for the context. These can be images and HTML files ready to server or JSP source files ready to be
196+
compiled. In traditional web servers this value is often called the docroot.</para>
178197
</listitem>
179198
</varlistentry>
180199
</variablelist>
@@ -195,23 +214,29 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
195214
discover and hot deploy context IoC descriptors like the following that creates a context to serve the javadoc
196215
from the jetty distribution:</para>
197216
<informalexample>
198-
<programlisting>
217+
<programlisting language="fetch">
199218
<filename>
200219
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-distribution/src/main/resources/webapps/javadoc.xml</filename>
201220
</programlisting>
202221
</informalexample>
222+
<para>TODO talk about properties supplied by configuration manager</para>
203223
</section>
204224
<section>
205225
<title>Standard Web App Configuration</title>
226+
<para>The majority of the configuration of a standard web application context is done by the <code>
227+
WEB-INF/web.xml</code> deployment descriptor found within the WAR file.</para>
228+
<para />
229+
<para>TODO talk about defaultweb.xml</para>
230+
<para>TODO talk about jetty-web.xml</para>
231+
<para>TODO Move this to 1.4 below ????</para>
206232
<para />
207-
</section>
208-
<section>
209-
<title>Standard Web App Configuration by IoC</title>
210-
<para>Jetty IoC XML that is found in a WEB-INF/jetty-web.xml of a standard web application.</para>
211233
</section>
212234
</section>
213235
<section>
214236
<title xml:id="intro-jetty-configuration-webapps">Configuring Web Applications</title>
237+
<para>TODO describe what is configured in web.xml entirely</para>
238+
<para>TODO describe what needs server services (eg realms and data sources)</para>
239+
<para />
215240
<para />
216241
</section>
217242
<section>

src/docbkx/quick-start/getting-started/jetty-running.xml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,27 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
1313
<para>If everything goes correctly you should see about 20 lines of logged INFO statements that will include lines
1414
like the following, that inform you of the components being started:</para>
1515
<informalexample>
16-
<programlisting language="text" xml:space="preserve"><![CDATA[2012-10-22 16:02:24.988:INFO:oejs.Server:main: jetty-9.0.0-M2
16+
<programlisting language="text" xml:space="preserve">
17+
<![CDATA[2012-10-22 16:02:24.988:INFO:oejs.Server:main: jetty-9.0.0-M2
1718
2012-10-22 16:02:25.040:INFO:oejs.NCSARequestLog:main: Opened /home/gregw/src/jetty-9/jetty-distribution/target/distribution/logs/2012_10_22.request.log
1819
2012-10-22 16:02:25.115:INFO:oejs.ServerConnector:main: Started ServerConnector@6aeeafb{HTTP/1.1}{0.0.0.0:8080}
1920
2012-10-22 16:02:25.348:INFO:oejs.ServerConnector:main: Started ServerConnector@24a45e{SSL-http/1.1}{0.0.0.0:8443}
2021
2012-10-22 16:02:25.357:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/home/gregw/src/jetty-9/jetty-distribution/target/distribution/webapps/] at interval 1
2122
2012-10-22 16:02:25.688:INFO:oejd.DeploymentManager:main: Deployable added: /home/gregw/src/jetty-9/jetty-distribution/target/distribution/webapps/test.xml
2223
2012-10-22 16:02:25.725:INFO:oejw.WebInfConfiguration:main: Extract jar:file:/home/gregw/src/jetty-9/jetty-distribution/target/distribution/webapps/test.war!/ to /tmp/jetty-0.0.0.0-8080-test.war-_test-any-/webapp
23-
2012-10-22 16:02:26.097:INFO:oejsh.ContextHandler:main: started o.e.j.w.WebAppContext@4e3ceb07{/test,file:/tmp/jetty-0.0.0.0-8080-test.war-_test-any-/webapp/,AVAILABLE}{/test.war}]]></programlisting>
24+
2012-10-22 16:02:26.097:INFO:oejsh.ContextHandler:main: started o.e.j.w.WebAppContext@4e3ceb07{/test,file:/tmp/jetty-0.0.0.0-8080-test.war-_test-any-/webapp/,AVAILABLE}{/test.war}]]>
25+
26+
27+
</programlisting>
2428
</informalexample>
2529
<para>You will also see some warnings like:</para>
2630
<informalexample>
27-
<programlisting language="text" xml:space="preserve"><![CDATA[2012-10-22 16:02:24.748:WARN::main: test-realm is deployed. DO NOT USE IN PRODUCTION!
28-
2012-10-22 16:02:25.582:WARN::main: async-rest webapp is deployed. DO NOT USE IN PRODUCTION!]]></programlisting>
31+
<programlisting language="text" xml:space="preserve">
32+
<![CDATA[2012-10-22 16:02:24.748:WARN::main: test-realm is deployed. DO NOT USE IN PRODUCTION!
33+
2012-10-22 16:02:25.582:WARN::main: async-rest webapp is deployed. DO NOT USE IN PRODUCTION!]]>
34+
35+
36+
</programlisting>
2937
</informalexample>
3038
<para>These warnings are telling you that some demonstration web applications and services are deployed and that they
3139
should be removed before the server is put into production. These warnings can be ignored while testing, or you can
@@ -43,10 +51,14 @@ xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns="http://docbook.org/ns/d
4351
<para>If you see the following exception you already have something running on the port that jetty is configured to
4452
run on and you either need to shut down whatever that process is, or configure jetty to run on another port.</para>
4553
<informalexample>
46-
<programlisting language="text" xml:space="preserve"><![CDATA[ java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method)
54+
<programlisting language="text" xml:space="preserve">
55+
<![CDATA[ java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method)
4756
at sun.nio.ch.Net.bind(Net.java:344)
4857
at sun.nio.ch.Net.bind(Net.java:336)
49-
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)]]></programlisting>
58+
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)]]>
59+
60+
61+
</programlisting>
5062
</informalexample>
5163
<para>Jetty can be made to run on a different port by adding setting the jetty.port Property on the command
5264
line:</para>

0 commit comments

Comments
 (0)