* Fixed substitutions for [source] blocks.
* Fixed callouts in XML, using the comment syntax. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
744146f36f
commit
84befe3957
|
@ -152,7 +152,7 @@ Consolidating parallel references saves readers from having to sift through repe
|
|||
|
||||
Instead of referencing multiple versions in your code and command-line examples, it's generally better to target one specific version, typically the latest (currently `{ee-current}`):
|
||||
|
||||
[source,subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --add-modules={ee-current}-deploy
|
||||
----
|
||||
|
|
|
@ -45,13 +45,13 @@ If it is `metadata-complete=false`, or your web.xml predates the inclusion of th
|
|||
To prevent annotation scanning you can use the `WebAppContext.setConfigurationDiscovered(false)` method.
|
||||
Here's an example context xml file that calls this method:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Set name="configurationDiscovered">false</Set> <2>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <!--1-->
|
||||
<Set name="configurationDiscovered">false</Set> <!--2-->
|
||||
</Configure>
|
||||
----
|
||||
<1> Configures a link:{javadoc-url}/org/eclipse/jetty/webapp/WebAppContext.html[`WebAppContext`], which is the Jetty component that represents a standard Servlet web application.
|
||||
|
@ -73,15 +73,15 @@ The value of this attribute is a regular expression.
|
|||
|
||||
Here's an example from a context xml file that includes any jar whose name starts with "foo-" or "bar-", or a directory named "classes":
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Call name="setAttribute"> <2>
|
||||
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> <3>
|
||||
<Arg>.*/foo-[^/]*\.jar$|.*/bar-[^/]*\.jar$|.*/classes/.*</Arg> <4>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <!--1-->
|
||||
<Call name="setAttribute"> <!--2-->
|
||||
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> <!--3-->
|
||||
<Arg>.*/foo-[^/]*\.jar$|.*/bar-[^/]*\.jar$|.*/classes/.*</Arg> <!--4-->
|
||||
</Call>
|
||||
</Configure>
|
||||
----
|
||||
|
@ -103,15 +103,15 @@ Use the `org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern` context attrib
|
|||
|
||||
Here's an example of a context xml file that sets a pattern that matches any jar on the webapp's classpath that starts with `spring-`:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Call name="setAttribute"> <2>
|
||||
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> <3>
|
||||
<Arg>.*/spring-[^/]*\.jar$</Arg> <4>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <!--1-->
|
||||
<Call name="setAttribute"> <!--2-->
|
||||
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> <!--3-->
|
||||
<Arg>.*/spring-[^/]*\.jar$</Arg> <!--4-->
|
||||
</Call>
|
||||
</Configure>
|
||||
----
|
||||
|
@ -169,15 +169,15 @@ In this case, you can define the `org.eclipse.jetty.containerInitializerExclusio
|
|||
This is a regular expression that defines http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html[patterns] of classnames that you want to exclude.
|
||||
Here's an example of setting the context attribute in a context xml file:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Call name="setAttribute"> <2>
|
||||
<Arg>org.eclipse.jetty.containerInitializerExclusionPattern</Arg> <3>
|
||||
<Arg>com.acme.*|com.corp.SlowContainerInitializer</Arg> <4>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <!--1-->
|
||||
<Call name="setAttribute"> <!--2-->
|
||||
<Arg>org.eclipse.jetty.containerInitializerExclusionPattern</Arg> <!--3-->
|
||||
<Arg>com.acme.*|com.corp.SlowContainerInitializer</Arg> <!--4-->
|
||||
</Call>
|
||||
</Configure>
|
||||
----
|
||||
|
@ -200,15 +200,15 @@ It will match all `ServletContainerInitializer` classes not explicitly named in
|
|||
|
||||
Here is an example context xml file that ensures the `com.example.PrioritySCI` will be called first, followed by the `com.acme.FooSCI`, then all other SCIs:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Call name="setAttribute"> <2>
|
||||
<Arg>org.eclipse.jetty.containerInitializerOrder</Arg> <3>
|
||||
<Arg>org.eclipse.jetty.websocket.javax.server.JavaxWebSocketServletContainerInitializer, com.acme.FooSCI, *</Arg> <4>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <!--1-->
|
||||
<Call name="setAttribute"> <!--2-->
|
||||
<Arg>org.eclipse.jetty.containerInitializerOrder</Arg> <!--3-->
|
||||
<Arg>org.eclipse.jetty.websocket.javax.server.JavaxWebSocketServletContainerInitializer, com.acme.FooSCI, *</Arg> <!--4-->
|
||||
</Call>
|
||||
</Configure>
|
||||
----
|
||||
|
|
|
@ -38,7 +38,7 @@ A standard Servlet web application is packaged in either a `+*.war+` file or in
|
|||
====
|
||||
Recall that the structure of a `+*.war+` file is as follows:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
mywebapp.war
|
||||
├── index.html <1>
|
||||
|
@ -63,12 +63,12 @@ The following examples assume you're deploying a Jakarta {ee-current-caps} appli
|
|||
Refer to the section about xref:og-deploy[deployment] for further information about how to deploy to different environments.
|
||||
====
|
||||
|
||||
[subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --add-modules={ee-current}-deploy
|
||||
----
|
||||
|
||||
[source,options=nowrap,subs=attributes]
|
||||
[source,options=nowrap,subs="verbatim,attributes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=http",args="--add-modules={ee-current}-deploy"]
|
||||
----
|
||||
|
@ -82,14 +82,14 @@ Refer to the xref:og-protocols[section about protocols] for further information.
|
|||
Now you're ready to copy a web application to the `$JETTY_BASE/webapps` directory.
|
||||
You can use one of the demos shipped with Jetty:
|
||||
|
||||
[subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --add-modules={ee-current}-demo-simple
|
||||
----
|
||||
|
||||
The `$JETTY_BASE` directory is now:
|
||||
|
||||
[subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── resources
|
||||
|
@ -108,7 +108,7 @@ Now start Jetty:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,attributes,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=http,deploy,{ee-current}-demo-simple",highlight="WebAppContext"]
|
||||
----
|
||||
|
|
|
@ -55,7 +55,7 @@ NOTE: If you want to enable support for protocols like secure HTTP/1.1 or HTTP/2
|
|||
$ java -jar $JETTY_HOME/start.jar --add-modules=http
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[args="--add-modules=http",highlight="([a-z\-]+ *transitively enabled)"]
|
||||
----
|
||||
|
@ -68,7 +68,7 @@ You can now start Jetty:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[args="--module=http",highlight="(\{.*:8080})"]
|
||||
----
|
||||
|
@ -78,7 +78,7 @@ But since it has no web applications deployed, it will just reply with `404 Not
|
|||
|
||||
Before you xref:og-begin-deploy[deploy your first web application], take a moment to see what happened to the `$JETTY_BASE` directory once you enabled the `http` module:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── resources
|
||||
|
@ -100,7 +100,7 @@ To manually configure such modules, you should activate them directly via Jetty'
|
|||
In the `http.ini` file you can find the following (among other contents):
|
||||
|
||||
.http.ini
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
--module=http <1>
|
||||
# jetty.http.port=8080 <2>
|
||||
|
@ -126,7 +126,7 @@ If you restart Jetty, it will use this new value:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[args="--module=http jetty.http.port=9999",highlight="(\{.*:9999})"]
|
||||
----
|
||||
|
@ -138,7 +138,7 @@ A property value specified on the command-line in this way will *override* the v
|
|||
$ java -jar $JETTY_HOME/start.jar jetty.http.port=8080
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[args="--module=http jetty.http.port=8080",highlight="(\{.*:8080})"]
|
||||
----
|
||||
|
|
|
@ -21,7 +21,7 @@ The web application resources are served by Jetty from the files extracted in th
|
|||
If you do not want Jetty to extract the `+*.war+` files, you can disable this feature, for example:
|
||||
|
||||
.mywebapp.xml
|
||||
[source,xml,highlight=8,subs="verbatim,attributes"]
|
||||
[source,xml,subs="verbatim,attributes,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -29,6 +29,6 @@ If you do not want Jetty to extract the `+*.war+` files, you can disable this fe
|
|||
<Configure class="org.eclipse.jetty.{ee-current}.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
<Set name="extractWAR">false</Set>
|
||||
#<Set name="extractWAR">false</Set>#
|
||||
</Configure>
|
||||
----
|
||||
|
|
|
@ -30,7 +30,7 @@ $ java -jar $JETTY_HOME/start.jar jetty.deploy.scanInterval=0
|
|||
To make _static_ deployment persistent, you need to edit the `deploy` module configuration file, `$JETTY_BASE/start.d/deploy.ini`, uncomment the module property `jetty.deploy.scanInterval` and change its value to `0`:
|
||||
|
||||
.deploy.ini
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
--module=deploy
|
||||
#jetty.deploy.scanInterval=0#
|
||||
|
|
|
@ -28,9 +28,9 @@ A simple Jetty context XML file, for example named `wiki.xml` is the following:
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.{ee-current}.webapp.WebAppContext"> <1>
|
||||
<Set name="contextPath">/wiki</Set> <2>
|
||||
<Set name="war">/opt/myapps/myapp.war</Set> <3>
|
||||
<Configure class="org.eclipse.jetty.{ee-current}.webapp.WebAppContext"> <!--1-->
|
||||
<Set name="contextPath">/wiki</Set> <!--2-->
|
||||
<Set name="war">/opt/myapps/myapp.war</Set> <!--3-->
|
||||
</Configure>
|
||||
----
|
||||
<1> Configures a link:{javadoc-url}/org/eclipse/jetty/{ee-current}/webapp/WebAppContext.html[`WebAppContext`], which is the Jetty component that represents a standard Servlet web application.
|
||||
|
@ -40,7 +40,7 @@ A simple Jetty context XML file, for example named `wiki.xml` is the following:
|
|||
The Jetty content XML file may be accompanied by a `+*.properties+` file that specifies the xref:og-deploy[environment] to use for the deployment:
|
||||
|
||||
.wiki.properties
|
||||
[source,properties,subs=attributes]
|
||||
[source,properties,subs="verbatim,attributes"]
|
||||
----
|
||||
environment={ee-current}
|
||||
----
|
||||
|
|
|
@ -18,7 +18,7 @@ A web application may _reference_ a JNDI entry, such as a JDBC `DataSource` from
|
|||
The JNDI entry must be _defined_ in a xref:og-jndi-xml[Jetty XML file], for example a context XML like so:
|
||||
|
||||
.mywebapp.xml
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
[source,xml,subs="verbatim,attributes,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -26,7 +26,7 @@ The JNDI entry must be _defined_ in a xref:og-jndi-xml[Jetty XML file], for exam
|
|||
<Configure id="wac" class="org.eclipse.jetty.{ee-current}.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
# <New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
#<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>jdbc/myds</Arg>
|
||||
<Arg>
|
||||
|
|
|
@ -19,7 +19,7 @@ This additional `web.xml` is processed _after_ the `+*.war+` file `web.xml`.
|
|||
This allows you to add host specific configuration or server specific configuration without having to extract the web application `web.xml`, modify it, and repackage it in the `+*.war+` file.
|
||||
|
||||
.mywebapp.xml
|
||||
[source,xml,highlight=8,subs="verbatim,attributes"]
|
||||
[source,xml,subs="verbatim,attributes,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -27,7 +27,7 @@ This allows you to add host specific configuration or server specific configurat
|
|||
<Configure class="org.eclipse.jetty.{ee-current}.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
<Set name="overrideDescriptor">/opt/webapps/mywebapp-web.xml</Set>
|
||||
#<Set name="overrideDescriptor">/opt/webapps/mywebapp-web.xml</Set>#
|
||||
</Configure>
|
||||
----
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ This configuration may be useful when Jetty sits behind a load balancer.
|
|||
In this case, you want to xref:og-protocols[configure multiple connectors], each with a different name, and then reference the connector name in the web application virtual host configuration:
|
||||
|
||||
.domain.xml
|
||||
[source,xml,highlight=10,subs="verbatim,attributes"]
|
||||
[source,xml,subs="verbatim,attributes,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -153,14 +153,14 @@ In this case, you want to xref:og-protocols[configure multiple connectors], each
|
|||
<Set name="war">/opt/webapps/domain.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
<Array type="java.lang.String">
|
||||
<Item>@port8080</Item>
|
||||
#<Item>@port8080</Item>#
|
||||
</Array>
|
||||
</Set>
|
||||
</Configure>
|
||||
----
|
||||
|
||||
.hobby.xml
|
||||
[source,xml,highlight=10,subs="verbatim,attributes"]
|
||||
[source,xml,subs="verbatim,attributes,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -170,7 +170,7 @@ In this case, you want to xref:og-protocols[configure multiple connectors], each
|
|||
<Set name="war">/opt/webapps/hobby.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
<Array type="java.lang.String">
|
||||
<Item>@port9090</Item>
|
||||
#<Item>@port9090</Item>#
|
||||
</Array>
|
||||
</Set>
|
||||
</Configure>
|
||||
|
|
|
@ -38,9 +38,9 @@ own custom link:https://docs.oracle.com/javase/7/docs/api/javax/security/auth/sp
|
|||
|
||||
Enable the `{ee-all}-jaas` module appropriate for your EE platform:
|
||||
|
||||
[subs=attributes]
|
||||
[source]
|
||||
----
|
||||
include::{jetty-home}/modules/{ee-current}-jaas.mod[]
|
||||
include::{jetty-home}/modules/jaas.mod[]
|
||||
----
|
||||
|
||||
The configurable items in the resulting `$jetty.base/start.d/jaas.ini` file are:
|
||||
|
@ -60,7 +60,7 @@ The `<realm-name>` in `web.xml` will be used to identify the `org.eclipse.jetty.
|
|||
|
||||
For example, this `web.xml` contains a realm called `Test JAAS Realm`:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<login-config>
|
||||
<auth-method>FORM</auth-method>
|
||||
|
@ -76,7 +76,7 @@ For example, this `web.xml` contains a realm called `Test JAAS Realm`:
|
|||
We now need to declare an `org.eclipse.jetty.security.jaas.JAASLoginService` that references the realm name of `Test JAAS Realm`.
|
||||
Here's an example of a suitable XML snippet:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New class="org.eclipse.jetty.security.jaas.JAASLoginService">
|
||||
<Set name="Name">Test JAAS Realm</Set> <!--1-->
|
||||
|
@ -138,7 +138,7 @@ Refer to the link:https://docs.oracle.com/javase/7/docs/api/javax/security/auth/
|
|||
|
||||
Remembering the example we set up xref:og-jaas-webapp[previously], the contents of the `$jetty.base/etc/login.conf` file could look as follows:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
xyz { <1>
|
||||
com.acme.SomeLoginModule required debug=true; <2>
|
||||
|
@ -172,7 +172,7 @@ You can configure the JDBC connection information, as well as the names of the t
|
|||
|
||||
Here is an example xref:og-jaas-loginconf[login module configuration file] entry for it using an HSQLDB driver:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
jdbc { <1>
|
||||
org.eclipse.jetty.security.jaas.spi.JDBCLoginModule required <2><3>
|
||||
|
@ -221,7 +221,7 @@ The `javax.sql.DataSource` is obtained at runtime by performing a JNDI lookup on
|
|||
|
||||
A sample login module configuration for this `LoginModule`:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
ds { <1>
|
||||
org.eclipse.jetty.security.jaas.spi.DataSourceLoginModule required <2><3>
|
||||
|
@ -249,7 +249,7 @@ ds { <1>
|
|||
|
||||
With this login module implementation, the authentication and role information is read from a property file.
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
props { <1>
|
||||
org.eclipse.jetty.security.jaas.spi.PropertyFileLoginModule required <2><3>
|
||||
|
@ -263,7 +263,7 @@ props { <1>
|
|||
|
||||
The property file must be of the format:
|
||||
|
||||
[source,text,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
<username>: <password> [,<rolename> ...]
|
||||
----
|
||||
|
@ -286,7 +286,7 @@ The LDAP connection information and structure of the authentication/authorizatio
|
|||
|
||||
Here's an example:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
example { <1>
|
||||
org.eclipse.jetty.security.jaas.spi.LdapLoginModule required <2><3>
|
||||
|
|
|
@ -35,7 +35,7 @@ include::{jetty-home}/modules/{ee-current}-jaspi.mod[]
|
|||
|
||||
Activate either the `ee9-jaspi` or `{ee-current}-jaspi` module, whichever matches your EE platform version.
|
||||
|
||||
[subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --add-modules={ee-current}-jaspi
|
||||
----
|
||||
|
|
|
@ -45,7 +45,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=jmx-remote
|
|||
|
||||
This command creates the `jmx-remote.ini` file:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
JETTY_BASE
|
||||
└── start.d
|
||||
|
@ -63,7 +63,7 @@ service:jmx:rmi://<rmi_server_host>:<rmi_server_port>/jndi/rmi://<rmi_registry_h
|
|||
|
||||
Below you can find examples of ``JMXServiceURL``s:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
*service:jmx:rmi:///jndi/rmi:///jmxrmi*
|
||||
where:
|
||||
|
|
|
@ -46,7 +46,7 @@ For the link between a `web.xml` resource name and a naming entry
|
|||
|
||||
Declarations of each of these types follow a similar pattern:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New class="org.eclipse.jetty.plus.jndi.xxxx"> <!--1-->
|
||||
<Arg><!-- scope --></Arg> <!--2-->
|
||||
|
@ -68,7 +68,7 @@ In such cases, you can use the `org.eclipse.jetty.plus.jndi.EnvEntry` class, and
|
|||
|
||||
Here's an example that defines the equivalent of an `env-entry` called `mySpecialValue` with value `4000` that overrides an `<env-entry>` declaration of the same name in web.xml:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New class="org.eclipse.jetty.plus.jndi.EnvEntry"> <!--1-->
|
||||
<Arg></Arg> <!--2-->
|
||||
|
@ -118,7 +118,7 @@ Let's examine how to configure some of the most common types of resources.
|
|||
|
||||
In this example, we'll configure a link:http://db.apache.org/derby[Derby] DataSource named `jdbc/myds`:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
|
@ -136,7 +136,7 @@ In this example, we'll configure a link:http://db.apache.org/derby[Derby] DataSo
|
|||
|
||||
This would linked into the webapps JNDI namespace via an entry in a `web.xml` like so:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<resource-ref>
|
||||
<res-ref-name>jdbc/myds</res-ref-name>
|
||||
|
@ -164,7 +164,7 @@ Jetty can bind any implementation of the JMS destinations and connection factori
|
|||
|
||||
Here is an example of binding an link:http://activemq.apache.org[ActiveMQ] in-JVM connection factory:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
|
@ -181,7 +181,7 @@ Here is an example of binding an link:http://activemq.apache.org[ActiveMQ] in-JV
|
|||
|
||||
The corresponding entry in `web.xml` to bind the ConnectionFactory into the webapp's JNDI namespace would be:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<resource-ref>
|
||||
<res-ref-name>jms/connectionFactory</res-ref-name>
|
||||
|
@ -200,7 +200,7 @@ Eg The ConnectionFactory bound in Jetty as `jms/inqueue` would be looked up by t
|
|||
|
||||
To configure access to `javax.mail.Session` from within a webapp, declare an `org.eclipse.jetty.plus.jndi.Resource` with an `org.eclipse.jetty.jndi.factories.MailSessionReference` that will hold the mail configuration and create the instance of the `Session` when it is referenced:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
|
@ -249,7 +249,7 @@ Use the link:{javadoc-url}/org/eclipse/jetty/plus/jndi/Transaction.html[org.ecli
|
|||
|
||||
The following example configures the link:http://www.atomikos.com/[Atomikos] transaction manager:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction">
|
||||
<Arg>
|
||||
|
@ -275,7 +275,7 @@ You can create a `WEB-INF/jetty-env.xml` file with an `org.eclipse.jetty.plus.jn
|
|||
|
||||
The context XML file declares `jdbc/workforce`:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
|
@ -293,7 +293,7 @@ The context XML file declares `jdbc/workforce`:
|
|||
|
||||
The `web.xml` refers to it as `jdbc/employees`:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<resource-ref>
|
||||
<res-ref-name>jdbc/employees</res-ref-name>
|
||||
|
@ -304,7 +304,7 @@ The `web.xml` refers to it as `jdbc/employees`:
|
|||
|
||||
Create a `WEB-INF/jetty-env.xml` file with a `org.eclipse.jetty.plus.jndi.Link` to link these names together:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New class="org.eclipse.jetty.plus.jndi.Link">
|
||||
<Arg><Ref refid='wac'/></Arg>
|
||||
|
@ -341,7 +341,7 @@ Naming resources within Jetty belong to one of three different scopes, in increa
|
|||
The name is unique across the JVM instance, and is visible to all application code.
|
||||
This scope is represented by a `null` first parameter to the resource declaration.
|
||||
For example:
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New id="cf" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg></Arg> <!--1-->
|
||||
|
@ -359,7 +359,7 @@ For example:
|
|||
The name is unique to a Server instance, and is only visible to applications associated with that instance.
|
||||
This scope is represented by referencing the Server instance as the first parameter to the resource declaration.
|
||||
For example:
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New id="cf" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="Server"/></Arg> <!--1-->
|
||||
|
@ -377,7 +377,7 @@ For example:
|
|||
The name is unique to the `org.eclipse.jetty.ee9.webapp.WebAppContext` instance, and is only visible to that application.
|
||||
This scope is represented by referencing the instance as the first parameter to the resource declaration.
|
||||
For example:
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid='wac'/></Arg> <!--1-->
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
Jetty supports JSP via the `{ee-all}-jsp` modules, which are based on Apache Jasper:
|
||||
|
||||
[subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
include::{jetty-home}/modules/{ee-current}-jsp.mod[]
|
||||
----
|
||||
|
@ -45,7 +45,7 @@ You can change to a different servlet, change or add ``<init-param>``s or add ex
|
|||
|
||||
Here's an example of adding an `<init-param>` to augment the definitions from the standard `webdefault.xml` file:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<servlet id="jsp"> <!--1-->
|
||||
<servlet-name>jsp</servlet-name> <!--2-->
|
||||
|
@ -62,7 +62,7 @@ Here's an example of adding an `<init-param>` to augment the definitions from th
|
|||
|
||||
Another element you might consider adding to the default setup is `async-supported`:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<servlet id="jsp"> <!--1-->
|
||||
<servlet-name>jsp</servlet-name> <!--2-->
|
||||
|
@ -175,7 +175,7 @@ If the value you set doesn't take effect, try using all lower case instead of ca
|
|||
|
||||
The JavaServer Pages Standard Tag Library (JSTL) is part of the Jetty distribution, and is available via the `{ee-all}-jstl` modules:
|
||||
|
||||
[subs=attributes]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
include::{jetty-home}/modules/{ee-current}-jstl.mod[]
|
||||
----
|
||||
|
@ -194,7 +194,7 @@ You will need to preserve the existing value of the attribute, and add in your e
|
|||
|
||||
Here's an example of using a context xml file to add in a pattern to match files starting with `jsf-`, which contain the `+*.tld+` files:
|
||||
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
|
|
@ -24,7 +24,7 @@ The _server authentication certificate_ may be different from the _server domain
|
|||
|
||||
First, you want to create the private key and server authentication certificate that you will use to sign client certificates:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
keytool
|
||||
-genkeypair
|
||||
|
@ -72,7 +72,7 @@ keytool
|
|||
|
||||
At this point, you want to create a client KeyStore, so that you can sign the client certificate with the server authentication cryptographic material:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
keytool
|
||||
-genkeypair
|
||||
|
|
|
@ -18,7 +18,7 @@ KeyStores are created with the JDK tool `$JAVA_HOME/bin/keytool`.
|
|||
|
||||
The following command creates a KeyStore file containing a private key and a self-signed certificate:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
keytool
|
||||
-genkeypair <1>
|
||||
|
|
|
@ -20,7 +20,7 @@ Browsers and generic clients (e.g. Java clients) have an internal list of truste
|
|||
|
||||
To have your self-signed certificate signed by a certificate authority you first need to produce a _certificate signing request_ (CSR):
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
keytool
|
||||
-certreq <1>
|
||||
|
@ -43,7 +43,7 @@ You must import *both* the certificate chain and your signed certificate.
|
|||
|
||||
First, import the certificate chain:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
keytool
|
||||
-importcert <1>
|
||||
|
|
|
@ -45,7 +45,7 @@ It is not uncommon for the network packets containing a request header to arrive
|
|||
`jetty.httpConfig.sendServerVersion`::
|
||||
Whether you want to send the `Server` header in every HTTP response:
|
||||
+
|
||||
[source,screen,subs=normal]
|
||||
[source,subs="verbatim,attributes"]
|
||||
----
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 0
|
||||
|
|
|
@ -68,7 +68,7 @@ CAUTION: The cipher list used above may not be secure -- it's just an example.
|
|||
Then write your custom module in the `$JETTY_BASE/modules/custom-ssl.mod` file:
|
||||
|
||||
.custom-ssl.mod
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
[description]
|
||||
Customizes the standard ssl module.
|
||||
|
@ -104,7 +104,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=https,custom-ssl
|
|||
|
||||
The command above will produce the following `$JETTY_BASE` directory structure:
|
||||
|
||||
[source,subs=normal]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── etc
|
||||
|
@ -156,7 +156,7 @@ Both `+*.jar+` files will be put in the `$JETTY_BASE/lib/` directory.
|
|||
Next, let's write the Jetty XML file that wires the auditing component to the `ServerConnector`, `$JETTY_BASE/etc/acme-audit.xml`:
|
||||
|
||||
.acme-audit.xml
|
||||
[source,xml,subs=verbatim,options=nowrap]
|
||||
[source,xml,options=nowrap]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -213,13 +213,14 @@ etc/acme-audit.xml
|
|||
|
||||
Now you can xref:og-start-configure-enable[enable] the custom auditing module with the following command issued from the `$JETTY_BASE` directory:
|
||||
|
||||
[source]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --add-modules=http,acme-audit
|
||||
----
|
||||
|
||||
The command above will produce the following `$JETTY_BASE` directory structure:
|
||||
|
||||
[source,subs=normal]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── etc
|
||||
|
|
|
@ -20,14 +20,14 @@ Clear text HTTP/1.1 is enabled with the `http` Jetty module with the following c
|
|||
$ java -jar $JETTY_HOME/start.jar --add-modules=http
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=http"]
|
||||
----
|
||||
|
||||
After having enabled the `http` module, the `$JETTY_BASE` directory looks like this:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
JETTY_BASE
|
||||
├── resources
|
||||
|
|
|
@ -31,7 +31,7 @@ Starting Jetty yields:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=http,http2c",highlight="(\{.+:8080})"]
|
||||
----
|
||||
|
|
|
@ -42,7 +42,7 @@ Starting Jetty yields:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=ssl,http2,https,test-keystore",highlight="(\{.*:8443})"]
|
||||
----
|
||||
|
|
|
@ -39,7 +39,7 @@ Starting Jetty yields:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--approve-all-licenses --add-modules=ssl,http3,test-keystore",highlight="(\{.*:8444})"]
|
||||
----
|
||||
|
|
|
@ -59,7 +59,7 @@ include::jetty[setupArgs="--add-modules=ssl,https",args="--add-modules=test-keys
|
|||
|
||||
The `$JETTY_BASE` directory is now:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
├── etc
|
||||
│ └── #test-keystore.p12#
|
||||
|
@ -77,7 +77,7 @@ Starting Jetty yields:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=ssl,https,test-keystore",highlight="(\{.*:8443})"]
|
||||
----
|
||||
|
|
|
@ -133,7 +133,7 @@ Starting Jetty yields:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[args="--module=proxy-protocol",highlight="(\{.*:8080})"]
|
||||
----
|
||||
|
@ -166,7 +166,7 @@ Starting Jetty yields:
|
|||
$ java -jar $JETTY_HOME/start.jar
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=https,test-keystore,proxy-protocol-ssl",highlight="(\{.*:8443})"]
|
||||
----
|
||||
|
@ -197,7 +197,7 @@ Now you can create the HAProxy configuration file (in Linux it's typically `/etc
|
|||
This is a minimal configuration:
|
||||
|
||||
.haproxy.cfg
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
global
|
||||
tune.ssl.default-dh-param 1024
|
||||
|
|
|
@ -43,7 +43,7 @@ For more advanced configuration you may want to configure the TLS protocol versi
|
|||
The correct way of doing this is to create a custom xref:og-xml[Jetty XML file] and reference it in `$JETTY_BASE/start.d/ssl.ini`:
|
||||
|
||||
.ssl.ini
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
jetty.sslContext.keyStorePassword=my_passwd! <1>
|
||||
etc/tls-config.xml <2>
|
||||
|
@ -56,7 +56,7 @@ The `ssl.ini` file above only shows the lines that are not commented out (you ca
|
|||
You want to create the `$JETTY_BASE/etc/tls-config.xml` with the following template content:
|
||||
|
||||
.tls-config.xml
|
||||
[source,xml,subs=verbatim]
|
||||
[source,xml]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
|
|
@ -43,7 +43,7 @@ When you enable the `logging-jetty` module -- either directly or by transitive d
|
|||
$ java -jar $JETTY_HOME/start.jar --add-modules=http
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[args="--add-modules=http",highlight="(logging-jetty *transitively enabled|copy.*\.properties)"]
|
||||
----
|
||||
|
|
|
@ -32,7 +32,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=threadpool,http
|
|||
|
||||
After the command above, the `$JETTY_BASE` directory looks like this:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── resources
|
||||
|
@ -63,7 +63,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=threadpool-virtual,http
|
|||
|
||||
After the command above, the `$JETTY_BASE` directory looks like this:
|
||||
|
||||
[source,subs=verbatim]
|
||||
[source]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── resources
|
||||
|
@ -75,7 +75,7 @@ $JETTY_BASE
|
|||
|
||||
Now you can customize the `threadpool-virtual.ini` file to explicitly configure the thread pool and the virtual threads and then start Jetty:
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=threadpool-virtual,http"]
|
||||
----
|
||||
|
|
|
@ -79,7 +79,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=server,http,logging-jetty
|
|||
|
||||
The `$JETTY_BASE` directory structure is now:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── resources
|
||||
|
@ -259,7 +259,7 @@ The `--dry-run` option is quite flexible and below you can find a few examples o
|
|||
|
||||
To display the `java` executable used to start Jetty:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --dry-run=##java##
|
||||
----
|
||||
|
@ -271,7 +271,7 @@ include::jetty[setupArgs="--add-modules=http",args="--dry-run=java"]
|
|||
|
||||
To display the JVM options:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --dry-run=##opts##
|
||||
----
|
||||
|
@ -283,7 +283,7 @@ include::jetty[setupModules="src/main/asciidoc/operations-guide/start/jvm.mod",s
|
|||
|
||||
To display the JVM class-path:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --dry-run=##path##
|
||||
----
|
||||
|
@ -295,7 +295,7 @@ include::jetty[setupModules="src/main/asciidoc/operations-guide/start/postgresql
|
|||
|
||||
To display the JVM class-path and module-path, if you want to xref:og-start-start-jpms[start Jetty using JPMS] with the `--jpms` option:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar ##--jpms## --dry-run=##path##
|
||||
----
|
||||
|
@ -307,7 +307,7 @@ include::jetty[setupModules="src/main/asciidoc/operations-guide/start/postgresql
|
|||
|
||||
To display the JVM main class:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --dry-run=##main##
|
||||
----
|
||||
|
@ -319,7 +319,7 @@ include::jetty[setupArgs="--add-modules=http",args="--dry-run=main"]
|
|||
|
||||
To display the JVM main class when xref:og-start-start-jpms[starting Jetty using JPMS]:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --jpms --dry-run=##main##
|
||||
----
|
||||
|
@ -334,7 +334,7 @@ The Jetty XML files compose together the Jetty components that are then configur
|
|||
|
||||
To display the program arguments passed to the main class:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --dry-run=##args##
|
||||
----
|
||||
|
@ -348,7 +348,7 @@ Note how the program arguments are a list of properties in the form `<name>=<val
|
|||
|
||||
The various parts of the full JVM command line can be combined to leverage the arguments file feature (that is, specify the JVM options in a file rather than on the command line) that is built-in in the `java` executable:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar --dry-run=##opts,path,main,args## > /tmp/jvm_cmd_line.txt
|
||||
$ /some/other/java @/tmp/jvm_cmd_line.txt
|
||||
|
@ -362,7 +362,7 @@ $ java $(java -jar $JETTY_HOME/start.jar --dry-run=opts,path,main,args)
|
|||
|
||||
The output of different `--dry-run` executions can be creatively combined in a shell script:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ OPTS=$(java -jar start.jar --dry-run=##opts,path##)
|
||||
$ MAIN=$(java -jar start.jar --dry-run=##main##)
|
||||
|
|
|
@ -23,7 +23,7 @@ Similarly, from a different terminal, you can exit the Jetty JVM using `kill -IN
|
|||
In the three cases above, the JVM is exited, but by default Jetty components are not stopped.
|
||||
If you want to stop the Jetty components, to stop Jetty more gracefully, you can start Jetty with this property:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar ##jetty.server.stopAtShutdown=true##
|
||||
----
|
||||
|
@ -45,12 +45,12 @@ You can start Jetty with the following properties:
|
|||
* `stop.port`, the port number Jetty will listen to for stop commands. Defaults to `-1`, which means that Jetty will not listen to any port.
|
||||
* `stop.key`, the password to verify when a stop command is received. Defaults to a password that is randomly generated and printed when Jetty starts.
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar ##stop.port=8181##
|
||||
----
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=http",args="stop.port=8181",highlight="(?i)stop.key"]
|
||||
----
|
||||
|
@ -61,7 +61,7 @@ CAUTION: You can choose your own `stop.key`, but make sure it's a strong passwor
|
|||
|
||||
A remote client can now use the Jetty start mechanism to stop the remote Jetty server:
|
||||
|
||||
[source,subs=normal]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar ##--stop## stop.port=8181 stop.key=<stop.key>
|
||||
----
|
||||
|
|
|
@ -46,7 +46,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=server,remote-debug
|
|||
|
||||
The command above minimally adds a Jetty server without connectors (via the `server` Jetty module) and the `remote-debug` Jetty module, and produces the following `$JETTY_BASE` directory structure:
|
||||
|
||||
[source,subs=normal]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$JETTY_BASE
|
||||
├── modules
|
||||
|
@ -64,7 +64,7 @@ Alternatively, you can enable the `remote-debug` module on the command line, as
|
|||
|
||||
Starting the Jetty server with the `remote-debug` module enabled yields:
|
||||
|
||||
[source,subs=quotes,options=nowrap]
|
||||
[source,options=nowrap,subs="verbatim,quotes"]
|
||||
----
|
||||
include::jetty[setupModules="src/main/asciidoc/operations-guide/troubleshooting/remote-debug.mod",setupArgs="--add-modules=server,remote-debug",highlight="5005"]
|
||||
----
|
||||
|
|
|
@ -49,7 +49,7 @@ The `Server.dump()` operation may also be invoked just after the `Server` starts
|
|||
|
||||
You can temporarily enable the Jetty Server Dump at start time by overriding the `jetty.server.dumpAfterStart` property on the command line:
|
||||
|
||||
[source,subs=quotes]
|
||||
[source,subs="verbatim,quotes"]
|
||||
----
|
||||
$ java -jar $JETTY_HOME/start.jar *jetty.server.dumpAfterStart=true*
|
||||
----
|
||||
|
@ -71,7 +71,7 @@ Detailed thread pool information can also be turned on/off on-the-fly via JMX, b
|
|||
|
||||
Below you can find a simple example of a Jetty Server Dump, with annotations for the principal components:
|
||||
|
||||
[source,subs=verbatim,role=small,options=nowrap]
|
||||
[source,role=small,options=nowrap]
|
||||
----
|
||||
include::jetty[setupArgs="--add-modules=http",args="jetty.http.selectors=1 jetty.http.acceptors=1 jetty.threadPool.minThreads=4 jetty.server.dumpAfterStart=true",delete="^[0-9]{4}",callouts=" <$N>,Server@,= QueuedThreadPool,HandlerList@,= ServerConnector,ManagedSelector@,keys @,startJarLoader@,unmanaged"]
|
||||
----
|
||||
|
|
|
@ -193,7 +193,7 @@ The `class` attribute (or `<Class>` element) can also be used to specify the Jav
|
|||
This is necessary when the object in scope, onto which the `<Call>` would be applied, is an instance of a class that is not visible to Jetty classes, or not accessible because it is not `public`.
|
||||
For example:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
@ -378,7 +378,7 @@ The `default` attribute allows you to specify a default value for the property,
|
|||
|
||||
For example, you may want to configure the context path of your web application in this way:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,quotes"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://eclipse.dev/jetty/configure_10_0.dtd">
|
||||
|
|
|
@ -29,7 +29,7 @@ Similarly, when a component is removed from the tree, `MBeanContainer` is notifi
|
|||
|
||||
The Maven coordinates for the Jetty JMX support are:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -46,7 +46,7 @@ Out of the box features that you get with the Jetty HTTP client include:
|
|||
The Jetty artifact that provides the main HTTP client implementation is `jetty-client`.
|
||||
The Maven artifact coordinates are the following:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -27,7 +27,7 @@ See also the correspondent xref:pg-server-http2[HTTP/2 server library].
|
|||
|
||||
The Maven artifact coordinates for the HTTP/2 client library are the following:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
|
@ -109,7 +109,7 @@ In order to send an HTTP request to the server, the client must send a `HEADERS`
|
|||
`HEADERS` frames carry the request method, the request URI and the request headers.
|
||||
Sending the `HEADERS` frame opens the `Stream`:
|
||||
|
||||
[source,java,indent=0,subs=normal]
|
||||
[source,java,indent=0,subs="verbatim,attributes"]
|
||||
----
|
||||
include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http2/HTTP2ClientDocs.java[tags=newStream]
|
||||
----
|
||||
|
|
|
@ -27,7 +27,7 @@ See also the correspondent xref:pg-server-http3[HTTP/3 server library].
|
|||
|
||||
The Maven artifact coordinates for the HTTP/3 client library are the following:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http3</groupId>
|
||||
|
@ -101,7 +101,7 @@ In order to send an HTTP request to the server, the client must send a `HEADERS`
|
|||
`HEADERS` frames carry the request method, the request URI and the request headers.
|
||||
Sending the `HEADERS` frame opens the `Stream`:
|
||||
|
||||
[source,java,indent=0,subs=normal]
|
||||
[source,java,indent=0,subs="verbatim,attributes"]
|
||||
----
|
||||
include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http3/HTTP3ClientDocs.java[tags=newStream]
|
||||
----
|
||||
|
|
|
@ -23,7 +23,7 @@ Since the first step of establishing a WebSocket communication is an HTTP reques
|
|||
|
||||
The Maven artifact coordinates are the following:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
|
|
|
@ -21,12 +21,12 @@ This plugin will help you pre-compile your JSP and works in conjunction with the
|
|||
|
||||
Here's the basic setup required to put the jspc plugin into your build:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jspc-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jspc</id>
|
||||
|
@ -43,32 +43,32 @@ Here's the basic setup required to put the jspc plugin into your build:
|
|||
The configurable parameters are as follows:
|
||||
|
||||
webXmlFragment::
|
||||
Default value: `$\{project.basedir}/target/webfrag.xml`
|
||||
Default value: `${project.basedir}/target/webfrag.xml`
|
||||
+
|
||||
File into which to generate the servlet declarations.
|
||||
Will be merged with an existing `web.xml`.
|
||||
webAppSourceDirectory::
|
||||
Default value: `$\{project.basedir}/src/main/webapp`
|
||||
Default value: `${project.basedir}/src/main/webapp`
|
||||
+
|
||||
Root of resources directory where jsps, tags etc are located.
|
||||
webXml::
|
||||
Default value: `$\{project.basedir}/src/main/webapp/WEB-INF/web.xml`
|
||||
Default value: `${project.basedir}/src/main/webapp/WEB-INF/web.xml`
|
||||
+
|
||||
The web.xml file to use to merge with the generated fragments.
|
||||
includes::
|
||||
Default value: `**\/*.jsp, **\/*.jspx`
|
||||
Default value: `+**/*.jsp, **/*.jspx+`
|
||||
+
|
||||
The comma separated list of patterns for file extensions to be processed.
|
||||
excludes::
|
||||
Default value: `**\/.svn\/**`
|
||||
Default value: `+**/.svn/**+`
|
||||
+
|
||||
The comma separated list of patterns for file extensions to be skipped.
|
||||
classesDirectory::
|
||||
Default value: `$\{project.build.outputDirectory}`
|
||||
Default value: `${project.build.outputDirectory}`
|
||||
+
|
||||
Location of classes for the webapp.
|
||||
generatedClasses::
|
||||
Default value: `$\{project.build.outputDirectory}`
|
||||
Default value: `${project.build.outputDirectory}`
|
||||
+
|
||||
Location to put the generated classes for the jsps.
|
||||
insertionMarker::
|
||||
|
@ -109,7 +109,7 @@ Introduced in Jetty 9.3.6.
|
|||
Java version of class files generated from jsps.
|
||||
Defaults to 1.7.
|
||||
tldJarNamePatterns::
|
||||
Default value: `.*taglibs[^/]*\.jar|.*jstl-impl[^/]*\.jar$`
|
||||
Default value: `+.*taglibs[^/]*\.jar|.*jstl[^/]*\.jar$+`
|
||||
+
|
||||
Patterns of jars on the 'system' (ie container) path that contain tlds.
|
||||
Use | to separate each pattern.
|
||||
|
@ -140,7 +140,7 @@ As compiling jsps is usually done during preparation for a production release an
|
|||
|
||||
For example, the following profile will only be invoked if the flag `-Dprod` is present on the run line:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<profiles>
|
||||
<profile>
|
||||
|
@ -153,7 +153,7 @@ For example, the following profile will only be invoked if the flag `-Dprod` is
|
|||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jspc-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<!-- put your configuration in here -->
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -222,12 +222,12 @@ Now you also need to configure the `jetty-jspc-maven-plugin` so that it can use
|
|||
This is in `target/foo/WEB-INF/web.xml`.
|
||||
Using the default settings, the `web.xml` merged with the jsp servlet definitions will be put into `target/web.xml`.
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jspc-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jspc</id>
|
||||
|
|
|
@ -94,7 +94,7 @@ public class HelloWorld extends AbstractHandler
|
|||
The `pom.xml` file declares the project name and its dependencies.
|
||||
Use an editor to create the file `pom.xml` in the `JettyMavenHelloWorld` directory with the following contents:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
|
@ -108,10 +108,7 @@ Use an editor to create the file `pom.xml` in the `JettyMavenHelloWorld` directo
|
|||
<name>Jetty HelloWorld</name>
|
||||
|
||||
<properties>
|
||||
<!-- Adapt this to a version found on
|
||||
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-maven-plugin/
|
||||
-->
|
||||
<jettyVersion>{VERSION}</jettyVersion>
|
||||
<jettyVersion>{version}</jettyVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -149,7 +146,7 @@ You can now compile and execute the HelloWorld class by using these commands:
|
|||
> mvn clean compile exec:java
|
||||
----
|
||||
|
||||
You can point your browser to `http://localhost:8080` to see the _Hello World_ page.
|
||||
You can point your browser to `+http://localhost:8080+` to see the _Hello World_ page.
|
||||
You can observe what Maven is doing for you behind the scenes by using the `mvn dependency:tree` command, which reveals the transitive dependency resolved and downloaded as:
|
||||
|
||||
----
|
||||
|
@ -249,7 +246,7 @@ You need to declare this servlet in the deployment descriptor, so create the fil
|
|||
The `pom.xml` file declares the project name and its dependencies.
|
||||
Use an editor to create the file `pom.xml` with the following contents in the `JettyMavenHelloWarApp` directory, noting particularly the declaration of the xref:jetty-maven-plugin[jetty-maven-plugin]:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
|
@ -263,7 +260,7 @@ Use an editor to create the file `pom.xml` with the following contents in the `J
|
|||
<name>Jetty HelloWorld WebApp</name>
|
||||
|
||||
<properties>
|
||||
<jettyVersion>{VERSION}</jettyVersion>
|
||||
<jettyVersion>{version}</jettyVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -297,7 +294,7 @@ Now you can both build and run the web application without needing to assemble i
|
|||
> mvn jetty:run
|
||||
----
|
||||
|
||||
You can see the static and dynamic content at `http://localhost:8080/hello`
|
||||
You can see the static and dynamic content at `+http://localhost:8080/hello+`
|
||||
|
||||
There are a great deal of configuration options available for the jetty-maven-plugin to help you build and run your webapp.
|
||||
The full reference is at xref:jetty-maven-plugin[Configuring the Jetty Maven Plugin].
|
||||
|
|
|
@ -59,12 +59,12 @@ We recommend either the traditional link:{DISTGUIDE}[distribution] deployment ap
|
|||
|
||||
First, add `jetty-maven-plugin` to your `pom.xml` definition:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
</plugin>
|
||||
----
|
||||
|
||||
|
@ -74,7 +74,7 @@ Then, from the same directory as your root `pom.xml`, type:
|
|||
mvn jetty:run
|
||||
----
|
||||
|
||||
This starts Jetty and serves up your project on http://localhost:8080/.
|
||||
This starts Jetty and serves up your project on `+http://localhost:8080/+`.
|
||||
|
||||
Jetty will continue to run until you stop it.
|
||||
By default, it will not automatically restart your webapp.
|
||||
|
@ -112,7 +112,7 @@ mvn jetty:help
|
|||
To see the detailed list of parameters that can be configured for a particular goal, in addition to its description, do:
|
||||
|
||||
----
|
||||
mvn jetty:help -Ddetail=true -Dgoal= <goal name>
|
||||
mvn jetty:help -Ddetail=true -Dgoal=<goalName>
|
||||
----
|
||||
|
||||
[[deployment-modes]]
|
||||
|
@ -320,12 +320,12 @@ Output from jetty will be logged to the console.
|
|||
|
||||
Here is an example, which turns on scanning for changes every ten seconds, and sets the webapp context path to `/test`:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<scan>10</scan>
|
||||
<webApp>
|
||||
|
@ -412,9 +412,9 @@ Patterns are specified as a relative path using a glob-like syntax as described
|
|||
|
||||
See xref:deployment-modes[Deployment Modes] for other configuration parameters available when using the `run` goal in EMBED, FORK or EXTERNAL modes.
|
||||
|
||||
Here's an example of a pom configuration for the plugin with the `run` goal:
|
||||
Here is an example of a pom configuration for the plugin with the `run` goal:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<project>
|
||||
...
|
||||
|
@ -423,7 +423,7 @@ Here's an example of a pom configuration for the plugin with the `run` goal:
|
|||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<webApp>
|
||||
<contextPath>/</contextPath>
|
||||
|
@ -529,12 +529,12 @@ Prior to jetty-9.4.7 any dependencies needed to be built first.
|
|||
|
||||
Here's an example of using the `pre-integration-test` and `post-integration-test` Maven build phases to trigger the execution and termination of Jetty:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<stopKey>foo</stopKey>
|
||||
<stopPort>9999</stopPort>
|
||||
|
@ -721,12 +721,12 @@ If false or not specified, the plugin does not wait for confirmation but exits a
|
|||
|
||||
Here's a configuration example:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<stopPort>9966</stopPort>
|
||||
<stopKey>foo</stopKey>
|
||||
|
@ -859,12 +859,12 @@ WebAppY:
|
|||
|
||||
They are configured for the http://maven.apache.org/plugins/maven-war-plugin/overlays.html[maven-war-plugin]:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<overlays>
|
||||
<overlay>
|
||||
|
@ -950,12 +950,12 @@ Then our webapp has available these additional resources:
|
|||
You can configure LoginServices in the plugin.
|
||||
Here's an example of setting up the HashLoginService for a webapp:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<scan>10</scan>
|
||||
<webApp>
|
||||
|
@ -969,7 +969,6 @@ Here's an example of setting up the HashLoginService for a webapp:
|
|||
</loginServices>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
----
|
||||
|
||||
[[using-multiple-webapp-root-directories]]
|
||||
|
@ -1005,12 +1004,12 @@ If you want to deploy webapp A, and webapps B and C in the same Jetty instance:
|
|||
|
||||
Putting the configuration in webapp A's `pom.xml`:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<scan>10</scan>
|
||||
<webApp>
|
||||
|
@ -1063,12 +1062,12 @@ Copy the `jetty.xml` file from the Jetty distribution, and then add WebAppContex
|
|||
|
||||
Then configure the location of this `jetty.xml` file into webapp A's jetty plugin:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>{VERSION}</version>
|
||||
<version>{version}</version>
|
||||
<configuration>
|
||||
<scan>10</scan>
|
||||
<webApp>
|
||||
|
@ -1096,7 +1095,6 @@ In the latter case, you can use the link:http://www.mojohaus.org/[maven properti
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>properties-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -1140,7 +1138,6 @@ Here's an example of how to specify System properties in the POM:
|
|||
</webApp>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
----
|
||||
|
||||
[[specifying-properties-in-file]]
|
||||
|
|
|
@ -190,7 +190,7 @@ Server
|
|||
|
||||
The Maven artifact coordinates are:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -404,7 +404,7 @@ With `ServletContextHandler` you can just put all your Servlet components in a `
|
|||
|
||||
The Maven artifact coordinates depend on the version of Jakarta EE you want to use, and they are:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.{ee-all}</groupId>
|
||||
|
@ -428,7 +428,7 @@ include::../../{doc_code}/org/eclipse/jetty/docs/programming/server/http/HTTPSer
|
|||
|
||||
The `Handler` and Servlet components tree structure looks like the following:
|
||||
|
||||
[source,screen,subs=normal]
|
||||
[source,screen,subs="verbatim,quotes"]
|
||||
----
|
||||
Server
|
||||
└── ServletContextHandler /shop
|
||||
|
@ -455,7 +455,7 @@ Server applications must be careful when creating the `Handler` tree to put ``Se
|
|||
|
||||
The Maven artifact coordinates depend on the version of Jakarta EE you want to use, and they are:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.{ee-all}</groupId>
|
||||
|
@ -510,7 +510,7 @@ The features are similar, but `DefaultServlet` is more commonly used to serve st
|
|||
|
||||
The Maven artifact coordinates depend on the version of Jakarta EE you want to use, and they are:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.{ee-all}</groupId>
|
||||
|
|
|
@ -25,7 +25,7 @@ Since not all web applications need support for the HTTP session, Jetty offers t
|
|||
|
||||
The Maven coordinates for the Jetty HTTP session support are:
|
||||
|
||||
[source,xml]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -22,7 +22,7 @@ This result in your web applications to be available to HTTP clients as if you d
|
|||
|
||||
The Maven artifact coordinates are:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -25,7 +25,7 @@ See also the correspondent xref:pg-client-http2[HTTP/2 client library].
|
|||
|
||||
The Maven artifact coordinates for the HTTP/2 client library are the following:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
|
|
|
@ -25,7 +25,7 @@ See also the correspondent xref:pg-client-http3[HTTP/3 client library].
|
|||
|
||||
The Maven artifact coordinates for the HTTP/3 client library are the following:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http3</groupId>
|
||||
|
|
|
@ -19,7 +19,7 @@ However, at runtime you need to have the _implementation_ of the Jetty WebSocket
|
|||
|
||||
Jetty's WebSocket APIs are provided by the following Maven artifact:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
|
@ -30,7 +30,7 @@ Jetty's WebSocket APIs are provided by the following Maven artifact:
|
|||
|
||||
Jetty's implementation of the Jetty WebSocket APIs is provided by the following Maven artifact (and its transitive dependencies):
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
|
|
|
@ -19,7 +19,7 @@ However, at runtime you need to have an implementation of the standard APIs in y
|
|||
|
||||
The standard `jakarta.websocket` APIs, for example for Jakarta {ee-current-caps}, are provided by the following Maven artifact:
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>jakarta.websocket</groupId>
|
||||
|
@ -30,7 +30,7 @@ The standard `jakarta.websocket` APIs, for example for Jakarta {ee-current-caps}
|
|||
|
||||
At runtime, you also need an implementation of the standard Jakarta {ee-current-caps} WebSocket APIs, that Jetty provides with the following Maven artifact (and its transitive dependencies):
|
||||
|
||||
[source,xml,subs=normal]
|
||||
[source,xml,subs="verbatim,attributes"]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.{ee-current}.websocket</groupId>
|
||||
|
|
|
@ -258,99 +258,4 @@ public class HTTP3ClientDocs
|
|||
stream.reset(HTTP3ErrorCode.REQUEST_CANCELLED_ERROR.code(), new ClosedChannelException());
|
||||
// end::reset[]
|
||||
}
|
||||
|
||||
// TODO: push not yet implemented in HTTP/3
|
||||
/*
|
||||
public void push() throws Exception
|
||||
{
|
||||
HTTP3Client http3Client = new HTTP3Client();
|
||||
http3Client.start();
|
||||
SocketAddress serverAddress = new InetSocketAddress("localhost", 8444);
|
||||
CompletableFuture<Session> sessionCF = http3Client.connect(serverAddress, new Session.Listener());
|
||||
Session session = sessionCF.get();
|
||||
|
||||
HttpFields requestHeaders = HttpFields.build()
|
||||
.put(HttpHeader.USER_AGENT, "Jetty HTTP3Client {version}");
|
||||
MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders);
|
||||
HeadersFrame headersFrame = new HeadersFrame(request, null, true);
|
||||
|
||||
// tag::push[]
|
||||
// Open a Stream by sending the HEADERS frame.
|
||||
CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener()
|
||||
{
|
||||
@Override
|
||||
public Stream.Listener onPush(Stream pushedStream, PushPromiseFrame frame)
|
||||
{
|
||||
// The "request" the client would make for the pushed resource.
|
||||
MetaData.Request pushedRequest = frame.getMetaData();
|
||||
// The pushed "request" URI.
|
||||
HttpURI pushedURI = pushedRequest.getURI();
|
||||
// The pushed "request" headers.
|
||||
HttpFields pushedRequestHeaders = pushedRequest.getFields();
|
||||
|
||||
// If needed, retrieve the primary stream that triggered the push.
|
||||
Stream primaryStream = pushedStream.getSession().getStream(frame.getStreamId());
|
||||
|
||||
// Return a Stream.Listener to listen for the pushed "response" events.
|
||||
return new Adapter()
|
||||
{
|
||||
@Override
|
||||
public void onHeaders(Stream stream, HeadersFrame frame)
|
||||
{
|
||||
// Handle the pushed stream "response".
|
||||
|
||||
MetaData metaData = frame.getMetaData();
|
||||
if (metaData.isResponse())
|
||||
{
|
||||
// The pushed "response" headers.
|
||||
HttpFields pushedResponseHeaders = metaData.getFields();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onData(Stream stream, DataFrame frame, Callback callback)
|
||||
{
|
||||
// Handle the pushed stream "response" content.
|
||||
|
||||
// The pushed stream "response" content bytes.
|
||||
ByteBuffer buffer = frame.getData();
|
||||
// Consume the buffer and complete the callback.
|
||||
callback.succeeded();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
// end::push[]
|
||||
}
|
||||
|
||||
public void pushReset() throws Exception
|
||||
{
|
||||
HTTP3Client http3Client = new HTTP3Client();
|
||||
http3Client.start();
|
||||
SocketAddress serverAddress = new InetSocketAddress("localhost", 8444);
|
||||
CompletableFuture<Session> sessionCF = http3Client.connect(serverAddress, new Session.Listener());
|
||||
Session session = sessionCF.get();
|
||||
|
||||
HttpFields requestHeaders = HttpFields.build()
|
||||
.put(HttpHeader.USER_AGENT, "Jetty HTTP3Client {version}");
|
||||
MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders);
|
||||
HeadersFrame headersFrame = new HeadersFrame(request, null, true);
|
||||
|
||||
// tag::pushReset[]
|
||||
// Open a Stream by sending the HEADERS frame.
|
||||
CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener()
|
||||
{
|
||||
@Override
|
||||
public Stream.Listener onPush(Stream pushedStream, PushPromiseFrame frame)
|
||||
{
|
||||
// Reset the pushed stream to tell the server we are not interested.
|
||||
pushedStream.reset(new ResetFrame(pushedStream.getId(), ErrorCode.CANCEL_STREAM_ERROR.code), Callback.NOOP);
|
||||
|
||||
// Not interested in listening to pushed response events.
|
||||
return null;
|
||||
}
|
||||
});
|
||||
// end::pushReset[]
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue