Jetty-12 Restructure
Copied over non ee10 components from the hackathon branch Co-authored-by: Greg Wilkins <gregw@webtide.com> Co-authored-by: Jan Bartel <janb@webtide.com> Co-authored-by: Joakim Erdfelt <joakim@webtide.com> Co-authored-by: Lachlan Roberts <lachlan@webtide.com> Co-authored-by: Ludovic Orban <lorban@webtide.com> Co-authored-by: Olivier Lamy <olamy@webtide.com> Co-authored-by: Simone Bordet <sbordet@webtide.com>
This commit is contained in:
parent
825fa75993
commit
04acdb72f0
|
@ -1,86 +1,118 @@
|
|||
#!groovy
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
agent {
|
||||
node { label 'linux' }
|
||||
}
|
||||
// save some io during the build
|
||||
options { durabilityHint('PERFORMANCE_OPTIMIZED') }
|
||||
stages {
|
||||
stage("Parallel Stage") {
|
||||
parallel {
|
||||
stage("Build / Test - JDK17") {
|
||||
agent { node { label 'linux' } }
|
||||
stage("Checkout Jetty") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Build & Test - JDK17") {
|
||||
stages {
|
||||
stage("Setup") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout( time: 180, unit: 'MINUTES' ) {
|
||||
mavenBuild( "jdk17", "clean install -Perrorprone", "maven3")
|
||||
// Collect up the jacoco execution results (only on main build)
|
||||
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
|
||||
exclusionPattern: '' +
|
||||
// build tools
|
||||
'**/org/eclipse/jetty/ant/**' + ',**/org/eclipse/jetty/maven/**' +
|
||||
',**/org/eclipse/jetty/jspc/**' +
|
||||
// example code / documentation
|
||||
',**/org/eclipse/jetty/embedded/**' + ',**/org/eclipse/jetty/asyncrest/**' +
|
||||
',**/org/eclipse/jetty/demo/**' +
|
||||
// special environments / late integrations
|
||||
',**/org/eclipse/jetty/gcloud/**' + ',**/org/eclipse/jetty/infinispan/**' +
|
||||
',**/org/eclipse/jetty/osgi/**' +
|
||||
',**/org/eclipse/jetty/http/spi/**' +
|
||||
// test classes
|
||||
',**/org/eclipse/jetty/tests/**' + ',**/org/eclipse/jetty/test/**',
|
||||
execPattern: '**/target/jacoco.exec',
|
||||
classPattern: '**/target/classes',
|
||||
sourcePattern: '**/src/main/java'
|
||||
recordIssues id: "jdk17", name: "Static Analysis jdk17", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), errorProne(), spotBugs()]
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
echo "Install org.eclipse.jetty:build-resources"
|
||||
mavenBuild("jdk17", "clean install -f build", "maven3")
|
||||
echo "Install org.eclipse.jetty:jetty-project"
|
||||
mavenBuild("jdk17", "-N clean install", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage("Build / Test - JDK11") {
|
||||
agent { node { label 'linux' } }
|
||||
stage("Module : /jetty-core/") {
|
||||
steps {
|
||||
container( 'jetty-build' ) {
|
||||
timeout( time: 180, unit: 'MINUTES' ) {
|
||||
mavenBuild( "jdk11", "clean install -Dspotbugs.skip=true -Djacoco.skip=true", "maven3")
|
||||
recordIssues id: "jdk11", name: "Static Analysis jdk11", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle()]
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f jetty-core", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage("Module : /jetty-ee9/") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f jetty-ee9", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Module : /jetty-ee10/") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f jetty-ee10", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*stage("Module : /jetty-integrations/") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f jetty-integrations", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
/*stage("Module : /jetty-home/") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f jetty-home", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
stage("Module : /tests/") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f tests", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
/*stage("Module : /documentation/") {
|
||||
steps {
|
||||
container('jetty-build') {
|
||||
timeout(time: 120, unit: 'MINUTES') {
|
||||
dir("${env.WORKSPACE}/buildy") {
|
||||
mavenBuild("jdk17", "clean install -f documentation", "maven3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
slackNotif()
|
||||
}
|
||||
unstable {
|
||||
slackNotif()
|
||||
}
|
||||
fixed {
|
||||
slackNotif()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def slackNotif() {
|
||||
script {
|
||||
try {
|
||||
if ( env.BRANCH_NAME == 'jetty-10.0.x' || env.BRANCH_NAME == 'jetty-11.0.x') {
|
||||
//BUILD_USER = currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
|
||||
// by ${BUILD_USER}
|
||||
COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
|
||||
slackSend channel: '#jenkins',
|
||||
color: COLOR_MAP[currentBuild.currentResult],
|
||||
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} - ${env.BUILD_URL}"
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace()
|
||||
echo "skip failure slack notification: " + e.getMessage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,14 +125,13 @@ def slackNotif() {
|
|||
* @return the Jenkinsfile step representing a maven build
|
||||
*/
|
||||
def mavenBuild(jdk, cmdline, mvnName) {
|
||||
script {
|
||||
try {
|
||||
withEnv(["JAVA_HOME=${ tool "$jdk" }",
|
||||
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
|
||||
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
|
||||
configFileProvider(
|
||||
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
|
||||
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline"
|
||||
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Pci --show-version --batch-mode --errors -Djetty.testtracker.log=true -Dmaven.test.failure.ignore=true $cmdline"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +139,6 @@ def mavenBuild(jdk, cmdline, mvnName) {
|
|||
{
|
||||
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim: et:ts=2:sw=2:ft=groovy
|
||||
|
|
|
@ -10,17 +10,8 @@ pipeline {
|
|||
// save some io during the build
|
||||
durabilityHint( 'PERFORMANCE_OPTIMIZED' )
|
||||
}
|
||||
parameters {
|
||||
string( defaultValue: 'jetty-10.0.x', description: 'GIT branch name to build (jetty-10.0.x/jetty-11.0.x/etc.)',
|
||||
name: 'JETTY_BRANCH' )
|
||||
}
|
||||
|
||||
stages {
|
||||
stage("Checkout Jetty Branch") {
|
||||
steps {
|
||||
git url: 'https://github.com/eclipse/jetty.project/', branch: '${JETTY_BRANCH}'
|
||||
}
|
||||
}
|
||||
stage( "Build / Test - JDK11" ) {
|
||||
agent {
|
||||
node { label 'linux' }
|
||||
|
@ -28,14 +19,8 @@ pipeline {
|
|||
steps {
|
||||
container( 'jetty-build' ) {
|
||||
timeout( time: 120, unit: 'MINUTES' ) {
|
||||
mavenBuild( "jdk11", "-T3 clean install -Djacoco.skip=true -pl :test-websocket-autobahn -am -Pautobahn -Dtest=AutobahnTests", "maven3" ) //
|
||||
mavenBuild( "jdk11", "-T3 clean install -Djacoco.skip=true -Pautobahn", "maven3", true ) //
|
||||
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml,**/target/autobahntestsuite-reports/*.xml'
|
||||
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/tests/test-websocket-autobahn/target/reports/core/servers", reportFiles: 'index.html', reportName: 'Autobahn Report Core Server', reportTitles: ''])
|
||||
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/tests/test-websocket-autobahn/target/reports/core/clients", reportFiles: 'index.html', reportName: 'Autobahn Report Core Client', reportTitles: ''])
|
||||
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/tests/test-websocket-autobahn/target/reports/javax/servers", reportFiles: 'index.html', reportName: 'Autobahn Report Javax Server', reportTitles: ''])
|
||||
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/tests/test-websocket-autobahn/target/reports/javax/clients", reportFiles: 'index.html', reportName: 'Autobahn Report Javax Client', reportTitles: ''])
|
||||
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/tests/test-websocket-autobahn/target/reports/jetty/servers", reportFiles: 'index.html', reportName: 'Autobahn Report Jetty Server', reportTitles: ''])
|
||||
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/tests/test-websocket-autobahn/target/reports/jetty/clients", reportFiles: 'index.html', reportName: 'Autobahn Report Jetty Client', reportTitles: ''])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,16 +68,19 @@ def slackNotif() {
|
|||
* @paran mvnName maven installation to use
|
||||
* @return the Jenkinsfile step representing a maven build
|
||||
*/
|
||||
def mavenBuild(jdk, cmdline, mvnName) {
|
||||
script {
|
||||
withEnv(["JAVA_HOME=${ tool "$jdk" }",
|
||||
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
|
||||
"MAVEN_OPTS=-Xms2g -Xmx8g -Djava.awt.headless=true"]) {
|
||||
configFileProvider(
|
||||
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
|
||||
sh "mvn -Denforcer.skip=true -Dlicense.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline"
|
||||
}
|
||||
}
|
||||
def mavenBuild(jdk, cmdline, mvnName, junitPublishDisabled) {
|
||||
def localRepo = ".repository"
|
||||
def mavenOpts = '-Xms1g -Xmx4g -Djava.awt.headless=true'
|
||||
|
||||
withMaven(
|
||||
maven: mvnName,
|
||||
jdk: "$jdk",
|
||||
publisherStrategy: 'EXPLICIT',
|
||||
options: [junitPublisher(disabled: junitPublishDisabled), mavenLinkerPublisher(disabled: false), pipelineGraphPublisher(disabled: false)],
|
||||
mavenOpts: mavenOpts,
|
||||
mavenLocalRepo: localRepo) {
|
||||
// Some common Maven command line + provided command line
|
||||
sh "mvn -Pci -V -B -e -fae -Dmaven.test.failure.ignore=true -Djetty.testtracker.log=true $cmdline"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
47
SECURITY.md
47
SECURITY.md
|
@ -1,47 +0,0 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
All [stable versions](https://www.eclipse.org/jetty/download.php) of jetty are actively supported for security issues. [Deprecated versions](https://www.eclipse.org/jetty/download.php) may be supported for serious security issues or on a commercial support basis.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Do not open a public issue to report a security vulnerability. Please send a message to security@eclipse.org and we will create a private issue in which the issue can be triaged and handled.
|
||||
|
||||
## Handling a Vulnerability
|
||||
|
||||
The [following checklist](https://www.eclipse.org/jetty/security_processes.php) is used to handle security issues:
|
||||
|
||||
- [ ] On receipt of a security report via security@webtide.com or other channels, if it cannot be trivially dismissed (already fixed, known not a problem, etc.), then a Github security advisory is created by project leadership.
|
||||
- [ ] Copy this list as a markdown in the security advisory for tracking the completion of various tasks.
|
||||
- [ ] Jetty committers and the reporters are added to the security advisory. Individual committers can also be named in the comments for addition.
|
||||
- [ ] Initial triage and discussion are performed in the comments of the advisory.
|
||||
- [ ] If enough information exists to attempt reproduction or fix, then a private repository is created as part of the GitHub security advisory.
|
||||
- [ ] If the vulnerability cannot be confirmed then close the security advisory, else continue.
|
||||
- [ ] Generate a CVE score and add it to the advisory description.
|
||||
- [ ] Identify a CWE Definition and add it to the advisory description.
|
||||
- [ ] Identify vulnerable version(s), including current and past versions that are affected (e.g. 9.4.0 through 9.4.35, and 10.0.0.alpha1 through 10.0.0.beta3…etc.)
|
||||
- [ ] Identify and document workaround(s), if applicable, in the comments of the security advisory.
|
||||
- [ ] Open an Eclipse Bugzilla issue to have a CVE allocated. The issue should be opened under the Community "Product" category with a "Component" of Vulnerability Reports. The CVE should include the following:
|
||||
1. Version(s) affected
|
||||
2. CVE Score
|
||||
3. CWE Identifier(s)
|
||||
4. Brief description of the issue
|
||||
- [ ] Once the CVE is allocated update the Security Advisory with the number
|
||||
- [ ] Build and test fix(es) locally and in CI environment.
|
||||
- [ ] Merge tests and fix - ensure description does not mention vulnerability directly. Do not merge directly from the security advisory as it can be traced back before publication.
|
||||
- [ ] Build and stage release candidate.
|
||||
- [ ] Notify interested parties of pending security advisory and staged release:
|
||||
1. Include CVE number, CVE score, and CWE
|
||||
2. Include Workarounds
|
||||
3. Stress that it is confidential
|
||||
4. Advise the security advisory will be published in 2 days unless they indicate they need more time.
|
||||
- [ ] If testing is OK, then the release is promoted.
|
||||
- [ ] Interested parties are notified of the availability of release on Maven Central.
|
||||
- [ ] Publish security advisory and CVE publicly.
|
||||
- [ ] Edit VERSION.txt and so that the CVE number is now recorded against merged PR.
|
||||
- [ ] Edit the release(s) on Github to identify CVE number that was addressed/resolved.
|
||||
- [ ] Update downstream images (Docker, etc.).
|
||||
- [ ] Update project website with new security entry.
|
||||
- [ ] Review security processes & completion.
|
||||
|
294
VERSION.txt
294
VERSION.txt
|
@ -1,228 +1,4 @@
|
|||
jetty-11.0.10-SNAPSHOT
|
||||
|
||||
jetty-11.0.9 - 30 March 2022
|
||||
+ 5681 Unrecognized jetty-home/start.jar command line option not reported
|
||||
clearly
|
||||
+ 5965 Option --write-module-graph produces wrong .dot file
|
||||
+ 6879 Remove jminix (not maintained) module as hawtio provide same features
|
||||
+ 7182 jetty.sh start process should remove jetty_state whenever deleting the
|
||||
pid
|
||||
+ 7344 Incompatible with jacoco due to shutdown race condition
|
||||
+ 7414 QoSFilter.setMaxRequests throws NullPointerException
|
||||
+ 7513 Getter/setter type mismatch for mbean attribute file in class
|
||||
org.eclipse.jetty.deploy.PropertiesConfigurationManager
|
||||
+ 7517 Some ArrayTrie methods throw StackOverflowError when cointaining a very
|
||||
large entry
|
||||
+ 7518 ArrayTrie getBest fails to match the empty string entry in certain
|
||||
cases
|
||||
+ 7545 Named arguments do not work in jetty-openid.xml
|
||||
+ 7548 Interrupt flag is not always cleared in between requests
|
||||
+ 7567 Gzip compression not working for multipart/form-data when added to the
|
||||
allowed list using addIncludedMimeTypes.
|
||||
+ 7573 WebSockets - "Unsupported PathParam Type: java.lang.Integer"
|
||||
+ 7575 Misleading docs for `HttpClientTransportDynamic`
|
||||
+ 7613 Configurations.add(Configuration) results in
|
||||
UnsupportedOperationException
|
||||
+ 7615 HttpServletResponse.encodeURL not working for URLs starting with ../
|
||||
+ 7617 Logback-access RequestLog not working
|
||||
+ 7625 HTTP/3 error against www.google.com
|
||||
+ 7677 jetty-maven-plugin - maven internal dependencies included on webapp
|
||||
classloader
|
||||
+ 7683 GZIPContentDecoder ignores setUseInputDirectByteBuffers setting and
|
||||
always uses non-direct buffers (causing GC locking)
|
||||
+ 7688 Read data to native memory from HttpInput
|
||||
+ 7748 Allow overriding of url-pattern mapping in ServletContextHandler to
|
||||
allow for regex or uri-template matching
|
||||
|
||||
jetty-11.0.8 - 07 February 2022
|
||||
+ 2504 Expose more WebSocket details in JMX and Server Dump
|
||||
+ 4275 Path Normalization/Traversal - Context Matching
|
||||
+ 4317 EventSource does not work with GzipHandler
|
||||
+ 6017 Property overriding does not work
|
||||
+ 6282 SecuredRedirectHandler should probably redirect with 301
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6728 QUIC and HTTP/3
|
||||
+ 6730 HTTP3: update Quiche to 0.9.0
|
||||
+ 6965 Expose Spec `ServerContainer.upgrade()` API
|
||||
+ 6973 Jetty starts consuming CPU that remains high even without any traffic
|
||||
+ 6974 Major websocket memory change in 9.4.36
|
||||
+ 6980 ELContextCleaner failed because cannot access a member of class
|
||||
javax.el.BeanELResolver with modifiers "private static final"
|
||||
+ 6985 ELContextCleaner references javax class in jetty-11
|
||||
+ 6987 jetty-unixdomain-server is missing from jetty-bom
|
||||
+ 6990 UnixDomainServerConnector throws misleading exception on invalid socket
|
||||
path
|
||||
+ 7008 Problem with jetty.sh start regression 10.0.6 -> 10.0.7 when using
|
||||
JETTY_USER
|
||||
+ 7012 Remove all old geronimo spec jars from jetty-10
|
||||
+ 7031 ResponseWriter.println(char) does not print newline
|
||||
+ 7042 Simplify configuration to use different OpenIdConfiguration per webapp
|
||||
+ 7059 NPE in AllowedResourceAliasChecker.getPath()
|
||||
+ 7063 Simplify command line use of org.eclipse.jetty.util.Password
|
||||
+ 7064 Cleanup or clarify `(null)` in output of `--list-config`
|
||||
+ 7086 WebSocket: java.lang.IllegalStateException: already released
|
||||
RetainableByteBuffer
|
||||
+ 7103 Rework LaF of distro landing page
|
||||
+ 7107 Client timeout and async close exceptions when setting max duration on
|
||||
pool
|
||||
+ 7109 Deprecate UnixSocket JNR support
|
||||
+ 7111 Add support to deprecate jetty-home modules
|
||||
+ 7113 Improve Unix-Domain client documentation
|
||||
+ 7124 Add default methods on LifeCycle.Listener interface
|
||||
+ 7131 Use Charset instead of encoding string where possible
|
||||
+ 7157 Multiplexed connection pools retain CLOSED entries
|
||||
+ 7160 HttpURI considers %25 to be ambiguous, preventing access to static
|
||||
resources with % in their name
|
||||
+ 7240 Clarify and javadoc InvocationType
|
||||
+ 7243 Reset pooled ByteBuffer endianness
|
||||
+ 7262 Allow the SerlvetHandler.getFilterChain method to be overridden
|
||||
+ 7277 Allow override of `ServletRequest.getLocalName()` and `.getLocalPort()`
|
||||
in post-intermediary scenarios
|
||||
+ 7280 Interceptors don't get destroyed in HttpInput
|
||||
+ 7281 EOFs are not passed to interceptors any more - shouldn't they?
|
||||
+ 7284 HttpInput reopen/recycle cleanup
|
||||
+ 7297 Deprecate log4j 1.x support
|
||||
+ 7313 addBean(_attributes); only called in the Convenience constructor of
|
||||
org.eclipse.jetty.server.Server
|
||||
+ 7327 jetty-slf4j-impl missing from BOM
|
||||
+ 7348 Slow CONNECT request causes NPE
|
||||
+ 7351 Large WebSocket payloads with permessage-deflate hang on 10.0.7
|
||||
+ 7354 Demo jars should not be in jetty-home
|
||||
+ 7369 Document CustomRequestLog
|
||||
+ 7375 Some environments require Request scoping during session save
|
||||
+ 7435 Investigate Infinispan transitive dependencies
|
||||
+ 7494 Remove modules in Jetty 11 that are not supporting jakarta.servlet yet
|
||||
+ 7496 Transient 400: Bad Request responses in jetty-9.4.45.v20220128
|
||||
+ 7514 Adding InheritedListeners to already-started components can cause
|
||||
IllegalStateException
|
||||
+ 7523 Typo in AnnotationConfiguration
|
||||
+ 7524 Missing package in JmxConfiguration
|
||||
+ 7529 Upgrade quiche to version 0.11.0
|
||||
|
||||
jetty-10.0.9 - 30 March 2022
|
||||
+ 5681 Unrecognized jetty-home/start.jar command line option not reported
|
||||
clearly
|
||||
+ 5965 Option --write-module-graph produces wrong .dot file
|
||||
+ 6879 Remove jminix (not maintained) module as hawtio provide same features
|
||||
+ 7182 jetty.sh start process should remove jetty_state whenever deleting the
|
||||
pid
|
||||
+ 7344 Incompatible with jacoco due to shutdown race condition
|
||||
+ 7414 QoSFilter.setMaxRequests throws NullPointerException
|
||||
+ 7513 Getter/setter type mismatch for mbean attribute file in class
|
||||
org.eclipse.jetty.deploy.PropertiesConfigurationManager
|
||||
+ 7517 Some ArrayTrie methods throw StackOverflowError when cointaining a very
|
||||
large entry
|
||||
+ 7518 ArrayTrie getBest fails to match the empty string entry in certain
|
||||
cases
|
||||
+ 7545 Named arguments do not work in jetty-openid.xml
|
||||
+ 7548 Interrupt flag is not always cleared in between requests
|
||||
+ 7567 Gzip compression not working for multipart/form-data when added to the
|
||||
allowed list using addIncludedMimeTypes.
|
||||
+ 7573 WebSockets - "Unsupported PathParam Type: java.lang.Integer"
|
||||
+ 7575 Misleading docs for `HttpClientTransportDynamic`
|
||||
+ 7613 Configurations.add(Configuration) results in
|
||||
UnsupportedOperationException
|
||||
+ 7615 HttpServletResponse.encodeURL not working for URLs starting with ../
|
||||
+ 7617 Logback-access RequestLog not working
|
||||
+ 7625 HTTP/3 error against www.google.com
|
||||
+ 7677 jetty-maven-plugin - maven internal dependencies included on webapp
|
||||
classloader
|
||||
+ 7683 GZIPContentDecoder ignores setUseInputDirectByteBuffers setting and
|
||||
always uses non-direct buffers (causing GC locking)
|
||||
+ 7688 Read data to native memory from HttpInput
|
||||
+ 7748 Allow overriding of url-pattern mapping in ServletContextHandler to
|
||||
allow for regex or uri-template matching
|
||||
|
||||
jetty-10.0.8 - 07 February 2022
|
||||
+ 2504 Expose more WebSocket details in JMX and Server Dump
|
||||
+ 4275 Path Normalization/Traversal - Context Matching
|
||||
+ 4317 EventSource does not work with GzipHandler
|
||||
+ 6017 Property overriding does not work
|
||||
+ 6282 SecuredRedirectHandler should probably redirect with 301
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6728 QUIC and HTTP/3
|
||||
+ 6730 HTTP3: update Quiche to 0.9.0
|
||||
+ 6965 Expose Spec `ServerContainer.upgrade()` API
|
||||
+ 6973 Jetty starts consuming CPU that remains high even without any traffic
|
||||
+ 6974 Major websocket memory change in 9.4.36
|
||||
+ 6980 ELContextCleaner failed because cannot access a member of class
|
||||
javax.el.BeanELResolver with modifiers "private static final"
|
||||
+ 6987 jetty-unixdomain-server is missing from jetty-bom
|
||||
+ 6990 UnixDomainServerConnector throws misleading exception on invalid socket
|
||||
path
|
||||
+ 7008 Problem with jetty.sh start regression 10.0.6 -> 10.0.7 when using
|
||||
JETTY_USER
|
||||
+ 7012 Remove all old geronimo spec jars from jetty-10
|
||||
+ 7031 ResponseWriter.println(char) does not print newline
|
||||
+ 7042 Simplify configuration to use different OpenIdConfiguration per webapp
|
||||
+ 7059 NPE in AllowedResourceAliasChecker.getPath()
|
||||
+ 7063 Simplify command line use of org.eclipse.jetty.util.Password
|
||||
+ 7064 Cleanup or clarify `(null)` in output of `--list-config`
|
||||
+ 7086 WebSocket: java.lang.IllegalStateException: already released
|
||||
RetainableByteBuffer
|
||||
+ 7103 Rework LaF of distro landing page
|
||||
+ 7107 Client timeout and async close exceptions when setting max duration on
|
||||
pool
|
||||
+ 7109 Deprecate UnixSocket JNR support
|
||||
+ 7111 Add support to deprecate jetty-home modules
|
||||
+ 7113 Improve Unix-Domain client documentation
|
||||
+ 7124 Add default methods on LifeCycle.Listener interface
|
||||
+ 7131 Use Charset instead of encoding string where possible
|
||||
+ 7157 Multiplexed connection pools retain CLOSED entries
|
||||
+ 7160 HttpURI considers %25 to be ambiguous, preventing access to static
|
||||
resources with % in their name
|
||||
+ 7240 Clarify and javadoc InvocationType
|
||||
+ 7243 Reset pooled ByteBuffer endianness
|
||||
+ 7262 Allow the SerlvetHandler.getFilterChain method to be overridden
|
||||
+ 7277 Allow override of `ServletRequest.getLocalName()` and `.getLocalPort()`
|
||||
in post-intermediary scenarios
|
||||
+ 7280 Interceptors don't get destroyed in HttpInput
|
||||
+ 7281 EOFs are not passed to interceptors any more - shouldn't they?
|
||||
+ 7284 HttpInput reopen/recycle cleanup
|
||||
+ 7297 Deprecate log4j 1.x support
|
||||
+ 7313 addBean(_attributes); only called in the Convenience constructor of
|
||||
org.eclipse.jetty.server.Server
|
||||
+ 7327 jetty-slf4j-impl missing from BOM
|
||||
+ 7348 Slow CONNECT request causes NPE
|
||||
+ 7351 Large WebSocket payloads with permessage-deflate hang on 10.0.7
|
||||
+ 7354 Demo jars should not be in jetty-home
|
||||
+ 7369 Document CustomRequestLog
|
||||
+ 7375 Some environments require Request scoping during session save
|
||||
+ 7435 Investigate Infinispan transitive dependencies
|
||||
+ 7496 Transient 400: Bad Request responses in jetty-9.4.45.v20220128
|
||||
+ 7514 Adding InheritedListeners to already-started components can cause
|
||||
IllegalStateException
|
||||
+ 7523 Typo in AnnotationConfiguration
|
||||
+ 7524 Missing package in JmxConfiguration
|
||||
+ 7529 Upgrade quiche to version 0.11.0
|
||||
|
||||
jetty-9.4.45.v20220203 - 03 February 2022
|
||||
+ 4275 Path Normalization/Traversal - Context Matching
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6687 Upgrade Infinispan in all active Jetty branches
|
||||
+ 6965 Expose Spec `ServerContainer.upgrade()` API
|
||||
+ 6969 Getting 404 failures when trying to enable `logging-log4j` module
|
||||
+ 6974 Major websocket memory change in 9.4.36
|
||||
+ 7031 ResponseWriter.println(char) does not print newline
|
||||
+ 7059 NPE in AllowedResourceAliasChecker.getPath()
|
||||
+ 7073 Error in parse parameter in broken UTF-8 encoding
|
||||
+ 7078 CompressionPools are not shared between multiple contexts for 9.4
|
||||
WebSocket
|
||||
+ 7107 Client timeout and async close exceptions when setting max duration on
|
||||
pool
|
||||
+ 7124 Add default methods on LifeCycle.Listener interface
|
||||
+ 7157 Multiplexed connection pools retain CLOSED entries
|
||||
+ 7243 Reset pooled ByteBuffer endianness
|
||||
+ 7266 Wrong ALPN jars are selected for newer versions of JDK8
|
||||
+ 7271 It is necessary to set MAX_CAPACITY to ArrayTernaryTrie/ArrayTrie
|
||||
+ 7277 Allow override of `ServletRequest.getLocalName()` and `.getLocalPort()`
|
||||
in post-intermediary scenarios
|
||||
+ 7297 Deprecate log4j 1.x support
|
||||
+ 7348 Slow CONNECT request causes NPE
|
||||
+ 7375 Some environments require Request scoping during session save
|
||||
+ 7435 Investigate Infinispan transitive dependencies
|
||||
+ 7440 ContextHandler.getAliasChecks() breaks Spring Boot
|
||||
+ 7496 Transient 400: Bad Request responses in jetty-9.4.45.v20220128
|
||||
jetty-12.0.0-SNAPSHOT
|
||||
|
||||
jetty-11.0.7 - 06 October 2021
|
||||
+ 3514 Use interpolation of versions from pom in mod files
|
||||
|
@ -238,15 +14,15 @@ jetty-11.0.7 - 06 October 2021
|
|||
active modules
|
||||
+ 6487 Expose ServletHolder getter in ServletHandler$ChainEnd for auditing
|
||||
libraries to use
|
||||
+ 6489 Some URI valid compliance modes cannot be set in .ini file
|
||||
+ 6489 Some URI valid compliance modes cannot be set in .ini file.
|
||||
+ 6491 onDataAvailable() not called when HttpParser is closed prematurely
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6520 Error page has HTML error when writePoweredBy is enabled
|
||||
+ 6520 Error page has HTML error when writePoweredBy is enabled.
|
||||
+ 6544 Using jetty.gzip.excludedMimeTypeList property results in an error
|
||||
+ 6545 image/webp MIME type support
|
||||
+ 6552 FileBufferedInterceptor.dispose not working due to locked file
|
||||
+ 6553 Review usage of Authentication.UNAUTHENTICATED in SecurityHandler
|
||||
+ 6554 Allow creation of DefaultIdentityService without realmName
|
||||
+ 6554 Allow creation of DefaultIdentityService without realmName.
|
||||
+ 6556 MemcachedSessionDataMap needs to set the context classloader before
|
||||
serialization/deseriazliation.
|
||||
+ 6558 Allow to configure return type in JSON array parsing
|
||||
|
@ -262,7 +38,7 @@ jetty-11.0.7 - 06 October 2021
|
|||
+ 6617 Add basic auth support for OpenId token endpoint (client_secret_basic)
|
||||
+ 6618 ID token `azp` claim should not be required if `aud` is single value
|
||||
array
|
||||
+ 6642 WebSocket handling of Connection: upgrade,close
|
||||
+ 6642 WebSocket handling of Connection: upgrade,close.
|
||||
+ 6646 Deadlock in HTTP2Flusher when using a small thread pool due to
|
||||
incorrect InvocableType
|
||||
+ 6652 Improve ReservedThreadExecutor dump
|
||||
|
@ -285,6 +61,19 @@ jetty-11.0.7 - 06 October 2021
|
|||
+ 6883 Welcome file redirects do not honor the relativeRedirectAllowed option
|
||||
+ 6938 module-info.java file do not use the canonical order for the elements
|
||||
|
||||
jetty-11.0.6 - 29 June 2021
|
||||
+ 6375 Always check XML `Set` elements with `property` attribute
|
||||
+ 6382 HttpClient TimeoutException message reports transient values
|
||||
+ 6394 Review osgi manifests within Jetty 10
|
||||
+ 6407 Malformed scheme logical expression check in WebSocket
|
||||
ClientUpgradeRequest
|
||||
+ 6410 Ensure Jetty IO uses SocketAddress instead of InetSocketAddress
|
||||
+ 6418 Bad and/or missing Require-Capability for osgi.serviceloader
|
||||
+ 6425 Update to asm 9.1
|
||||
+ 6447 Deprecate support for UTF16 encoding in URIs
|
||||
+ 6451 Request#getServletPath() returns null for ROOT mapping
|
||||
+ 6464 Wrong files/lib definitions in certain *-capture.mod files?
|
||||
|
||||
jetty-10.0.7 - 06 October 2021
|
||||
+ 3514 Use interpolation of versions from pom in mod files
|
||||
+ 6043 Reimplement UnixSocket support based on Java 16
|
||||
|
@ -298,15 +87,15 @@ jetty-10.0.7 - 06 October 2021
|
|||
active modules
|
||||
+ 6487 Expose ServletHolder getter in ServletHandler$ChainEnd for auditing
|
||||
libraries to use
|
||||
+ 6489 Some URI valid compliance modes cannot be set in .ini file
|
||||
+ 6489 Some URI valid compliance modes cannot be set in .ini file.
|
||||
+ 6491 onDataAvailable() not called when HttpParser is closed prematurely
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6520 Error page has HTML error when writePoweredBy is enabled
|
||||
+ 6520 Error page has HTML error when writePoweredBy is enabled.
|
||||
+ 6544 Using jetty.gzip.excludedMimeTypeList property results in an error
|
||||
+ 6545 image/webp MIME type support
|
||||
+ 6552 FileBufferedInterceptor.dispose not working due to locked file
|
||||
+ 6553 Review usage of Authentication.UNAUTHENTICATED in SecurityHandler
|
||||
+ 6554 Allow creation of DefaultIdentityService without realmName
|
||||
+ 6554 Allow creation of DefaultIdentityService without realmName.
|
||||
+ 6556 MemcachedSessionDataMap needs to set the context classloader before
|
||||
serialization/deseriazliation.
|
||||
+ 6558 Allow to configure return type in JSON array parsing
|
||||
|
@ -321,7 +110,7 @@ jetty-10.0.7 - 06 October 2021
|
|||
+ 6617 Add basic auth support for OpenId token endpoint (client_secret_basic)
|
||||
+ 6618 ID token `azp` claim should not be required if `aud` is single value
|
||||
array
|
||||
+ 6642 WebSocket handling of Connection: upgrade,close
|
||||
+ 6642 WebSocket handling of Connection: upgrade,close.
|
||||
+ 6646 Deadlock in HTTP2Flusher when using a small thread pool due to
|
||||
incorrect InvocableType
|
||||
+ 6652 Improve ReservedThreadExecutor dump
|
||||
|
@ -342,45 +131,6 @@ jetty-10.0.7 - 06 October 2021
|
|||
+ 6883 Welcome file redirects do not honor the relativeRedirectAllowed option
|
||||
+ 6938 module-info.java file do not use the canonical order for the elements
|
||||
|
||||
jetty-9.4.44.v20210927 - 27 September 2021
|
||||
+ 3514 Use interpolation of versions from pom in mod files
|
||||
+ 6369 Increment default jetty.http2.rateControl.maxEventsPerSecond
|
||||
+ 6372 Review socket options configuration
|
||||
+ 6487 Expose ServletHolder getter in ServletHandler$ChainEnd for auditing
|
||||
libraries to use
|
||||
+ 6491 onDataAvailable() not called when HttpParser is closed prematurely
|
||||
+ 6520 Error page has HTML error when writePoweredBy is enabled
|
||||
+ 6545 image/webp MIME type support
|
||||
+ 6553 Review usage of Authentication.UNAUTHENTICATED in SecurityHandler
|
||||
+ 6554 Allow creation of DefaultIdentityService without realmName
|
||||
+ 6558 Allow to configure return type in JSON array parsing
|
||||
+ 6562 HttpOutput.write(ByteBuffer buffer)
|
||||
+ 6603 HTTP/2 max local stream count exceeded
|
||||
+ 6617 Add basic auth support for OpenId token endpoint (client_secret_basic)
|
||||
+ 6618 ID token `azp` claim should not be required if `aud` is single value
|
||||
array
|
||||
+ 6652 Improve ReservedThreadExecutor dump
|
||||
+ 6671 Update to apache jsp 8.5.70
|
||||
+ 6772 Update to asm 9.2
|
||||
+ 6853 Remove pack200 plugins
|
||||
+ 6860 Correct IPv6 format
|
||||
+ 6869 Correct Content-Type within HTML error pages
|
||||
+ 6870 Encode control characters in URIUtil.encodePath
|
||||
+ 6883 Welcome file redirects do not honor the relativeRedirectAllowed option
|
||||
|
||||
jetty-11.0.6 - 29 June 2021
|
||||
+ 6375 Always check XML `Set` elements with `property` attribute
|
||||
+ 6382 HttpClient TimeoutException message reports transient values
|
||||
+ 6394 Review osgi manifests within Jetty 10
|
||||
+ 6407 Malformed scheme logical expression check in WebSocket
|
||||
ClientUpgradeRequest
|
||||
+ 6410 Ensure Jetty IO uses SocketAddress instead of InetSocketAddress
|
||||
+ 6418 Bad and/or missing Require-Capability for osgi.serviceloader
|
||||
+ 6425 Update to asm 9.1
|
||||
+ 6447 Deprecate support for UTF16 encoding in URIs
|
||||
+ 6451 Request#getServletPath() returns null for ROOT mapping
|
||||
+ 6464 Wrong files/lib definitions in certain *-capture.mod files?
|
||||
|
||||
jetty-10.0.6 - 29 June 2021
|
||||
+ 6375 Always check XML `Set` elements with `property` attribute
|
||||
+ 6382 HttpClient TimeoutException message reports transient values
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
org.eclipse.jetty.apache.jsp.JettyJasperInitializer
|
|
@ -1 +0,0 @@
|
|||
org.eclipse.jetty.apache.jsp.JuliLog
|
|
@ -7,7 +7,7 @@
|
|||
-->
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>build-resources</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
<version>12.0.0-SNAPSHOT</version>
|
||||
<name>Jetty :: Build Resources</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<!-- versions for these plugins are not based on parent pom -->
|
||||
<maven.deploy.plugin.version>3.0.0-M2</maven.deploy.plugin.version>
|
||||
<maven.javadoc.plugin.version>3.4.0</maven.javadoc.plugin.version>
|
||||
<maven.javadoc.plugin.version>3.3.1</maven.javadoc.plugin.version>
|
||||
<maven.remote-resources.plugin.version>1.6.0</maven.remote-resources.plugin.version>
|
||||
<maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
|
||||
</properties>
|
|
@ -1,25 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
<version>12.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-unixsocket</artifactId>
|
||||
<groupId>org.eclipse.jetty.build</groupId>
|
||||
<artifactId>build</artifactId>
|
||||
<name>Build :: Parent</name>
|
||||
<packaging>pom</packaging>
|
||||
<name>Jetty :: UnixSocket</name>
|
||||
|
||||
<description>Jetty UnixSocket Parent</description>
|
||||
|
||||
<modules>
|
||||
<module>jetty-unixsocket-common</module>
|
||||
<module>jetty-unixsocket-client</module>
|
||||
<module>jetty-unixsocket-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<spotbugs.onlyAnalyze>org.eclipse.jetty.unixsocket.*</spotbugs.onlyAnalyze>
|
||||
<sonar.skip>true</sonar.skip>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>build-resources</module>
|
||||
</modules>
|
||||
</project>
|
|
@ -1,19 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demos-parent</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-async-rest-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Demo :: Async Rest</name>
|
||||
|
||||
<modules>
|
||||
<module>demo-async-rest-jar</module>
|
||||
<module>demo-async-rest-webapp</module>
|
||||
<module>demo-async-rest-server</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
|
@ -1,3 +0,0 @@
|
|||
# Jetty Logging using jetty-slf4j-impl
|
||||
com.acme.LEVEL=INFO
|
||||
# org.eclipse.jetty.annotations.LEVEL=DEBUG
|
|
@ -1 +0,0 @@
|
|||
protocol=smtp; type=transport; class=com.acme.MockTransport; vendor=Acme Tests;
|
|
@ -1 +0,0 @@
|
|||
com.acme.initializer.FooInitializer
|
|
@ -2,8 +2,8 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.documentation</groupId>
|
||||
<artifactId>documentation-parent</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
<artifactId>documentation</artifactId>
|
||||
<version>12.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -2,14 +2,17 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.documentation</groupId>
|
||||
<artifactId>documentation-parent</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
<artifactId>documentation</artifactId>
|
||||
<version>12.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-documentation</artifactId>
|
||||
<name>Jetty :: Documentation</name>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<ee.version>ee9</ee.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -136,6 +139,18 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-bom</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
|
@ -162,20 +177,20 @@
|
|||
<artifactId>jetty-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-servlet</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-servlets</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util-ajax</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-webapp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
|
@ -215,16 +230,16 @@
|
|||
<artifactId>jetty-nosql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-jetty-client</artifactId>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-websocket-jetty-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-jakarta-server</artifactId>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-websocket-jakarta-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-jetty-server</artifactId>
|
||||
<groupId>org.eclipse.jetty.${ee.version}</groupId>
|
||||
<artifactId>jetty-${ee.version}-websocket-jetty-server</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -28,7 +28,7 @@ Annotations and JNDI are pre-enabled for the Maven plugin.
|
|||
==== Embedding
|
||||
|
||||
To use annotations in an embedded scenario, you will need to include the `jetty-annotations` jar and all its dependencies onto your classpath.
|
||||
You will also need to include the `org.eclipse.jetty.annotations.AnnotationConfiguration` class into the list of link:#webapp-configurations[Configuration classes] applied to the `org.eclipse.jetty.webapp.WebAppContext` class representing your webapp.
|
||||
You will also need to include the `org.eclipse.jetty.annotations.AnnotationConfiguration` class into the list of link:#webapp-configurations[Configuration classes] applied to the `org.eclipse.jetty.ee9.webapp.WebAppContext` class representing your webapp.
|
||||
|
||||
Below is an example application that sets up the standard `test-spec.war` webapp from the distribution in embedded fashion.
|
||||
It can also be found in the Jetty GitHub repository on the examples/embedded page as link:{GITBROWSEURL}/examples/embedded/src/main/java/org/eclipse/jetty/embedded[`ServerWithAnnotations.java`.]
|
||||
|
|
|
@ -38,7 +38,7 @@ The code is as follows:
|
|||
----
|
||||
import org.eclipse.jetty.security.HashLoginService;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
* ServerWithAnnotations
|
||||
|
@ -53,9 +53,9 @@ public class ServerWithAnnotations
|
|||
Server server = new Server(8080);
|
||||
|
||||
//Enable parsing of jndi-related parts of web.xml and jetty-env.xml
|
||||
org.eclipse.jetty.webapp.Configuration.ClassList classlist = org.eclipse.jetty.webapp.Configuration.ClassList.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");
|
||||
org.eclipse.jetty.ee9.webapp.Configuration.ClassList classlist = org.eclipse.jetty.ee9.webapp.Configuration.ClassList.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.ee9.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
classlist.addBefore("org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");
|
||||
|
||||
//Create a WebApp
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
|
|
|
@ -462,7 +462,7 @@ deploying more than one web application:::
|
|||
|
||||
As the `org.eclipse.jetty.ant.AntWebAppContext` class is an extension of
|
||||
the
|
||||
link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[`org.eclipse.jetty.webapp.WebAppContext`]
|
||||
link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[`org.eclipse.jetty.ee9.webapp.WebAppContext`]
|
||||
class, you can configure it by adding attributes of the same name
|
||||
(without the `set` or `add` prefix) as the setter methods.
|
||||
|
||||
|
|
|
@ -57,12 +57,12 @@ Below is an example of implementing this feature using Jetty IoC XML format:
|
|||
|
||||
[source, xml, options="header"]
|
||||
----
|
||||
<Configure id="mywebapp" class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id="mywebapp" class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
...
|
||||
|
||||
<Set name="classLoader">
|
||||
<New class="org.eclipse.jetty.webapp.CachingWebAppClassLoader">
|
||||
<New class="org.eclipse.jetty.ee9.webapp.CachingWebAppClassLoader">
|
||||
<Arg><Ref refid="mywebapp"/></Arg>
|
||||
</New>
|
||||
</Set>
|
||||
|
@ -97,7 +97,7 @@ The default system classes are:
|
|||
|org.eclipse.jetty.jndi. |Webapp can see and not change naming classes.
|
||||
|org.eclipse.jetty.jaas. |Webapp can see and not change JAAS classes.
|
||||
|org.eclipse.jetty.websocket. |WebSocket is a Jetty extension.
|
||||
|org.eclipse.jetty.servlet.DefaultServlet |Webapp can see and not change default servlet.
|
||||
|org.eclipse.jetty.ee9.servlet.DefaultServlet |Webapp can see and not change default servlet.
|
||||
|=======================================================================
|
||||
|
||||
Absolute classname can be passed, names ending with `.` are treated as packages names, and names starting with `-` are treated as negative matches and must be listed before any enclosing packages.
|
||||
|
@ -105,8 +105,8 @@ Absolute classname can be passed, names ending with `.` are treated as packages
|
|||
[[setting-server-classes]]
|
||||
===== Setting Server Classes
|
||||
|
||||
You can call the methods link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#setServerClasses%28java.lang.String%5B%5D%29[org.eclipse.jetty.webapp.WebAppContext.setServerClasses(String Array)] or
|
||||
link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#addServerClass(java.lang.String)[org.eclipse.jetty.webapp.WebAppContext.addServerClass(String)] to allow fine control over which classes are considered Server classes.
|
||||
You can call the methods link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#setServerClasses%28java.lang.String%5B%5D%29[org.eclipse.jetty.ee9.webapp.WebAppContext.setServerClasses(String Array)] or
|
||||
link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#addServerClass(java.lang.String)[org.eclipse.jetty.ee9.webapp.WebAppContext.addServerClass(String)] to allow fine control over which classes are considered Server classes.
|
||||
|
||||
* A web application cannot see a Server class.
|
||||
* A WEB-INF class can replace a Server class.
|
||||
|
@ -120,9 +120,9 @@ The default server classes are:
|
|||
|-org.eclipse.jetty.continuation. |Don't hide continuation classes.
|
||||
|-org.eclipse.jetty.jndi. |Don't hide naming classes.
|
||||
|-org.eclipse.jetty.jaas. |Don't hide jaas classes.
|
||||
|-org.eclipse.jetty.servlets. |Don't hide utility servlet classes if provided.
|
||||
|-org.eclipse.jetty.servlet.DefaultServlet |Don't hide default servlet.
|
||||
|-org.eclipse.jetty.servlet.listener. |Don't hide utility listeners
|
||||
|-org.eclipse.jetty.ee9.servlets. |Don't hide utility servlet classes if provided.
|
||||
|-org.eclipse.jetty.ee9.servlet.DefaultServlet |Don't hide default servlet.
|
||||
|-org.eclipse.jetty.ee9.servlet.listener. |Don't hide utility listeners
|
||||
|-org.eclipse.jetty.websocket. |Don't hide websocket extension.
|
||||
| org.eclipse.jetty. |Do hide all other Jetty classes.
|
||||
|=======================================================================
|
||||
|
@ -145,12 +145,12 @@ You can place additional Jars here.
|
|||
[[using-extra-classpath-method]]
|
||||
===== Using the extraClasspath() method
|
||||
|
||||
You can add an additional classpath to a context classloader by calling link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#setExtraClasspath(java.lang.String)[org.eclipse.jetty.webapp.WebAppContext.setExtraClasspath(String)] with a comma-separated list of paths.
|
||||
You can add an additional classpath to a context classloader by calling link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#setExtraClasspath(java.lang.String)[org.eclipse.jetty.ee9.webapp.WebAppContext.setExtraClasspath(String)] with a comma-separated list of paths.
|
||||
You can do so directly to the API via a context XML file such as the following:
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
...
|
||||
<Set name="extraClasspath">../my/classes,../my/jars/special.jar,../my/jars/other.jar</Set>
|
||||
...
|
||||
|
|
|
@ -74,7 +74,7 @@ Context files are normally located in `${jetty.base}/webapps/` (see `DeployerMan
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/test</Set>
|
||||
<Set name="war">
|
||||
<SystemProperty name="jetty.base" default="."/>/webapps/test
|
||||
|
@ -114,8 +114,8 @@ Context files are normally located in `${jetty.base}/webapps/` (see `DeployerMan
|
|||
|
||||
==== Custom ErrorHandler class
|
||||
|
||||
If no error page mapping is defined, or if the error page resource itself has an error, then the error page will be generated by an instance of `ErrorHandler` configured either the Context or the Server.
|
||||
An `ErrorHandler` may extend the `ErrorHandler` class and may totally replace the handle method to generate an error page, or it can implement some or all of the following methods to partially modify the error pages:
|
||||
If no error page mapping is defined, or if the error page resource itself has an error, then the error page will be generated by an instance of `ErrorProcessor` configured either the Context or the Server.
|
||||
An `ErrorProcessor` may extend the `ErrorProcessor` class and may totally replace the handle method to generate an error page, or it can implement some or all of the following methods to partially modify the error pages:
|
||||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
|
@ -128,7 +128,7 @@ void writeErrorPageMessage(HttpServletRequest request, Writer writer, int code,
|
|||
void writeErrorPageStacks(HttpServletRequest request, Writer writer) throws IOException
|
||||
----
|
||||
|
||||
An `ErrorHandler` instance may be set on a Context by calling the `ContextHandler.setErrorHandler` method. This can be done by embedded code or via context IoC XML.
|
||||
An `ErrorProcessor` instance may be set on a Context by calling the `ContextHandler.setErrorHandler` method. This can be done by embedded code or via context IoC XML.
|
||||
For example:
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
|
@ -142,7 +142,7 @@ For example:
|
|||
</Configure>
|
||||
----
|
||||
|
||||
An `ErrorHandler` instance may be set on the entire server by setting it as a dependent bean on the Server instance.
|
||||
An `ErrorProcessor` instance may be set on the entire server by setting it as a dependent bean on the Server instance.
|
||||
This can be done by calling `Server.addBean(Object)` via embedded code or in `jetty.xml` IoC XML:
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
|
|
|
@ -42,7 +42,7 @@ For example:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/test</Set>
|
||||
...
|
||||
</Configure>
|
||||
|
|
|
@ -36,7 +36,7 @@ In either case the syntax of the XML file is the same:
|
|||
|
||||
[source,xml,subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- Max Form Size -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
|
|
|
@ -39,7 +39,7 @@ Once the temp directory is created, it is retrievable as the value (as a File) o
|
|||
===== The location of the temp directory
|
||||
|
||||
By default, Jetty will create this directory inside the directory named by the `java.io.tmpdir` System property.
|
||||
You can instruct Jetty to use a different parent directory by setting the context attribute `org.eclipse.jetty.webapp.basetempdir` to the name of the desired parent directory.
|
||||
You can instruct Jetty to use a different parent directory by setting the context attribute `org.eclipse.jetty.ee9.webapp.basetempdir` to the name of the desired parent directory.
|
||||
The directory named by this attribute _must_ exist and be __writeable__.
|
||||
|
||||
As usual with Jetty, you can either set this attribute in a context xml file, or you can do it in code.
|
||||
|
@ -48,13 +48,13 @@ Here's an example of setting it in an xml file:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Set name="contextPath">/test</Set>
|
||||
<Set name="war">foo.war</Set>
|
||||
|
||||
<Call name="setAttribute">
|
||||
<Arg>org.eclipse.jetty.webapp.basetempdir</Arg>
|
||||
<Arg>org.eclipse.jetty.ee9.webapp.basetempdir</Arg>
|
||||
<Arg>/home/my/foo</Arg>
|
||||
</Call>
|
||||
</Configure>
|
||||
|
@ -67,7 +67,7 @@ The equivalent in code is:
|
|||
WebAppContext context = new WebAppContext();
|
||||
context.setContextPath("/test");
|
||||
context.setWar("foo.war");
|
||||
context.setAttribute("org.eclipse.jetty.webapp.basetempdir", "/tmp/foo");
|
||||
context.setAttribute("org.eclipse.jetty.ee9.webapp.basetempdir", "/tmp/foo");
|
||||
----
|
||||
|
||||
==== Setting a Specific Temp Directory
|
||||
|
@ -80,7 +80,7 @@ Here is an example of setting the temp directory in XML:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Set name="contextPath">/test</Set>
|
||||
<Set name="war">foo.war</Set>
|
||||
|
@ -105,7 +105,7 @@ Again, you can do this in XML:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Set name="contextPath">/test</Set>
|
||||
<Set name="war">foo.war</Set>
|
||||
|
|
|
@ -43,7 +43,7 @@ For example, here is a descriptor file that deploys the file `/opt/myapp/myapp.w
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war">/opt/myapp/myapp.war</Set>
|
||||
</Configure>
|
||||
|
@ -57,7 +57,7 @@ For example, if the system property is set to `myapp.home=/opt/myapp`, the previ
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war"><SystemProperty name="myapp.home"/>/myapp.war</Set>
|
||||
</Configure>
|
||||
|
@ -85,7 +85,7 @@ This can help make it clear that users should not make changes to the temporary
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war"><SystemProperty name="myapp.home"/>/myapp.war</Set>
|
||||
<Set name="extractWAR">false</Set>
|
||||
|
@ -101,7 +101,7 @@ However, since the `web.xml` for the web application is processed after the depl
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war"><SystemProperty name="myapp.home"/>/myapp.war</Set>
|
||||
<Get name="ServletContext">
|
||||
|
@ -122,7 +122,7 @@ This feature is useful when adding parameters or additional Servlet mappings wit
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war"><SystemProperty name="myapp.home"/>/myapp.war</Set>
|
||||
<Set name="overrideDescriptor">/opt/myapp/overlay-web.xml</Set>
|
||||
|
@ -137,7 +137,7 @@ If the `web.xml` does not include a reference to this data source, an override d
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war"><SystemProperty name="myapp.home"/>/myapp.war</Set>
|
||||
|
||||
|
|
|
@ -76,11 +76,11 @@ The format for the XML file is the same as any context XML file and can be used
|
|||
|
||||
To use this binding, you can either modify the existing `jetty-deploy.xml` which comes with the Jetty distribution (be sure to link:#startup-base-and-home[copy it to your $JETTY_BASE/etc directory first]), or by link:#custom-modules[creating a new module] file which calls to an additional XML file.
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
[source,xml,subs="{sub-order}"]
|
||||
----
|
||||
<Call name="addLifeCycleBinding">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.deploy.bindings.GlobalWebappConfigBinding" >
|
||||
<New class="org.eclipse.jetty.ee10.deployer.GlobalWebappConfigBinding" >
|
||||
<Set name="jettyXml"><Property name="jetty.home" default="." />/etc/global-webapp-config.xml</Set>
|
||||
</New>
|
||||
</Arg>
|
||||
|
@ -96,7 +96,7 @@ It supports hot (re)deployment.
|
|||
The basic operation of the `WebAppProvider` is to periodically scan a directory for deployables.
|
||||
In the standard Jetty Distribution, this is configured in the `${jetty.home}/etc/jetty-deploy.xml` file.
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
[source,xml,subs="{sub-order}"]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
@ -110,7 +110,7 @@ In the standard Jetty Distribution, this is configured in the `${jetty.home}/etc
|
|||
</Set>
|
||||
<Call id="webappprovider" name="addAppProvider">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
|
||||
<New class="org.eclipse.jetty.ee10.deployer.WebAppProvider">
|
||||
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set>
|
||||
<Set name="defaultsDescriptor"><Property name="jetty.home" default="." />/etc/webdefault.xml</Set>
|
||||
<Set name="scanInterval">1</Set>
|
||||
|
|
|
@ -23,27 +23,27 @@ If instead you're looking for information on how to configure a specific `WebApp
|
|||
[[webapp-configurations]]
|
||||
==== Configuration Classes
|
||||
|
||||
As a webapp is being deployed, a series of link:{JDURL}/org/eclipse/jetty/webapp/Configuration.html[org.eclipse.jetty.webapp.Configuration] classes are applied to it, each one performing a specific function.
|
||||
As a webapp is being deployed, a series of link:{JDURL}/org/eclipse/jetty/webapp/Configuration.html[org.eclipse.jetty.ee9.webapp.Configuration] classes are applied to it, each one performing a specific function.
|
||||
The ordering of these Configurations is significant as subsequent Configurations tend to build on information extracted or setup in foregoing Configurations.
|
||||
These are the default list, in order, of Configurations that are applied to each link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[org.eclipse.jetty.webapp.WebAppContex]t:
|
||||
These are the default list, in order, of Configurations that are applied to each link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[org.eclipse.jetty.ee9.webapp.WebAppContex]t:
|
||||
|
||||
.Default Configuration classes
|
||||
[cols=",",]
|
||||
|=======================================================================
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/WebInfConfiguration.html[org.eclipse.jetty.webapp.WebInfConfiguration]
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/WebInfConfiguration.html[org.eclipse.jetty.ee9.webapp.WebInfConfiguration]
|
||||
|Extracts war, orders jars and defines classpath
|
||||
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/WebXmlConfiguration.html[org.eclipse.jetty.webapp.WebXmlConfiguration]
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/WebXmlConfiguration.html[org.eclipse.jetty.ee9.webapp.WebXmlConfiguration]
|
||||
|Processes a WEB-INF/web.xml file
|
||||
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/MetaInfConfiguration.html[org.eclipse.jetty.webapp.MetaInfConfiguration]
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/MetaInfConfiguration.html[org.eclipse.jetty.ee9.webapp.MetaInfConfiguration]
|
||||
|Looks in container and webapp jars for META-INF/resources and
|
||||
META-INF/web-fragment.xml
|
||||
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/FragmentConfiguration.html[org.eclipse.jetty.webapp.FragmentConfiguration]
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/FragmentConfiguration.html[org.eclipse.jetty.ee9.webapp.FragmentConfiguration]
|
||||
|Processes all discovered META-INF/web-fragment.xml files
|
||||
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.html[org.eclipse.jetty.webapp.JettyWebXmlConfiguration]
|
||||
|link:{JDURL}/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.html[org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration]
|
||||
|Processes a WEB-INF/jetty-web.xml file
|
||||
|=======================================================================
|
||||
|
||||
|
@ -99,7 +99,7 @@ To achieve that, we use 2 extra Configurations:
|
|||
|Processes JNDI related aspects of `WEB-INF/web.xml` and hooks up naming entries
|
||||
|=======================================================================
|
||||
|
||||
These configurations must be added in _exactly_ the order shown above and should be inserted _immediately before_ the link:{JDURL}/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.html[org.eclipse.jetty.webapp.JettyWebXmlConfiguration] class in the list of configurations.
|
||||
These configurations must be added in _exactly_ the order shown above and should be inserted _immediately before_ the link:{JDURL}/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.html[org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration] class in the list of configurations.
|
||||
To fully support JNDI additional configuration is required, full details of which can be found link:#jndi[here].
|
||||
|
||||
====== Example: Annotation Configurations
|
||||
|
@ -114,7 +114,7 @@ We need just one extra Configuration class to help provide servlet annotation sc
|
|||
@WebListener etc
|
||||
|=======================================================================
|
||||
|
||||
The above configuration class must be _inserted immediately before_ the link:{JDURL}/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.html[org.eclipse.jetty.webapp.JettyWebXmlConfiguration] class in the list of configurations.
|
||||
The above configuration class must be _inserted immediately before_ the link:{JDURL}/org/eclipse/jetty/webapp/JettyWebXmlConfiguration.html[org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration] class in the list of configurations.
|
||||
To fully support annotations additional configuration is require, details of which can be found link:#webapp-context-attributes[below.]
|
||||
|
||||
===== How to Set the List of Configurations
|
||||
|
@ -132,20 +132,20 @@ Let's see an example of how we would add in the Configurations for both JNDI _an
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Set name="war"><SystemProperty name="jetty.base" default="."/>/webapps/my-cool-webapp</Set>
|
||||
|
||||
<Set name="configurationClasses">
|
||||
<Array type="java.lang.String">
|
||||
<Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.WebInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.WebXmlConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.MetaInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.FragmentConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration</Item>
|
||||
</Array>
|
||||
</Set>
|
||||
|
||||
|
@ -159,7 +159,7 @@ Of course, you can also use this method to reduce the Configurations applied to
|
|||
If you use the link:#deployment-architecture[deployer], you can set up the list of Configuration classes on the link:#default-web-app-provider[WebAppProvider].
|
||||
They will then be applied to each `WebAppContext` deployed by the deployer:
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
[source,xml,subs="{sub-order}"]
|
||||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
@ -174,18 +174,18 @@ They will then be applied to each `WebAppContext` deployed by the deployer:
|
|||
</Set>
|
||||
<Call id="webappprovider" name="addAppProvider">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
|
||||
<New class="org.eclipse.jetty.ee10.deployer.WebAppProvider">
|
||||
<Set name="monitoredDirName"><Property name="jetty.base" default="." />/webapps</Set>
|
||||
<Set name="configurationClasses">
|
||||
<Array type="java.lang.String">
|
||||
<Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.WebInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.WebXmlConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.MetaInfConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.FragmentConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
|
||||
<Item>org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration</Item>
|
||||
</Array>
|
||||
</Set>
|
||||
</New>
|
||||
|
@ -213,10 +213,10 @@ This example uses an xml file, in fact it is the `$JETTY_HOME/etc/jetty-plus.xml
|
|||
<!-- =========================================================== -->
|
||||
<!-- Add plus Configuring classes to all webapps for this Server -->
|
||||
<!-- =========================================================== -->
|
||||
<Call class="org.eclipse.jetty.webapp.Configuration$ClassList" name="setServerDefault">
|
||||
<Call class="org.eclipse.jetty.ee9.webapp.Configuration$ClassList" name="setServerDefault">
|
||||
<Arg><Ref refid="Server" /></Arg>
|
||||
<Call name="addAfter">
|
||||
<Arg name="afterClass">org.eclipse.jetty.webapp.FragmentConfiguration</Arg>
|
||||
<Arg name="afterClass">org.eclipse.jetty.ee9.webapp.FragmentConfiguration</Arg>
|
||||
<Arg>
|
||||
<Array type="String">
|
||||
<Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
|
||||
|
@ -229,7 +229,7 @@ This example uses an xml file, in fact it is the `$JETTY_HOME/etc/jetty-plus.xml
|
|||
</Configure>
|
||||
----
|
||||
|
||||
The link:{JDURL}/org/eclipse/jetty/webapp/Configuration.html[org.eclipse.jetty.webapp.Configuration.ClassList] class provides these methods for insertion:
|
||||
The link:{JDURL}/org/eclipse/jetty/webapp/Configuration.html[org.eclipse.jetty.ee9.webapp.Configuration.ClassList] class provides these methods for insertion:
|
||||
|
||||
addAfter::
|
||||
Inserts the supplied list of `Configuration` class names after the given Configuration class name.
|
||||
|
@ -242,7 +242,7 @@ addBefore::
|
|||
[[container-include-jar-pattern]]
|
||||
===== org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
|
||||
|
||||
This is a link:#context_attributes[context attribute] that can be set on link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[an org.eclipse.jetty.webapp.WebAppContext] to control which parts of the _container's_ classpath should be processed for things like annotations, `META-INF/resources`, `META-INF/web-fragment.xml` and `tlds` inside `META-INF`.
|
||||
This is a link:#context_attributes[context attribute] that can be set on link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html[an org.eclipse.jetty.ee9.webapp.WebAppContext] to control which parts of the _container's_ classpath should be processed for things like annotations, `META-INF/resources`, `META-INF/web-fragment.xml` and `tlds` inside `META-INF`.
|
||||
|
||||
Normally, nothing from the container classpath will be included for processing.
|
||||
However, sometimes you will need to include some.
|
||||
|
@ -258,7 +258,7 @@ Here's an example from a context xml file (although as always, you could have ac
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Call name="setAttribute">
|
||||
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
||||
|
@ -284,7 +284,7 @@ Here's an example in a xml file of a pattern that matches any jar that starts wi
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Call name="setAttribute">
|
||||
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
|
||||
|
|
|
@ -59,9 +59,9 @@ In a Maven project you add a dependency on the artifact `jetty-quickstart`.
|
|||
|
||||
===== Configuration
|
||||
|
||||
Webapps need to be instances of link:{JDURL}/org/eclipse/jetty/quickstart/QuickStartWebApp.html[`org.eclipse.jetty.quickstart.QuickStartWebApp`] rather than the normal `org.eclipse.jetty.webapp.WebAppContext`.
|
||||
Webapps need to be instances of link:{JDURL}/org/eclipse/jetty/quickstart/QuickStartWebApp.html[`org.eclipse.jetty.quickstart.QuickStartWebApp`] rather than the normal `org.eclipse.jetty.ee9.webapp.WebAppContext`.
|
||||
|
||||
`org.eclipse.jetty.quickstart.QuickStartWebApp` instances offer the same setters as the familiar `org.eclipse.jetty.webapp.WebAppContext`, with the addition of:
|
||||
`org.eclipse.jetty.quickstart.QuickStartWebApp` instances offer the same setters as the familiar `org.eclipse.jetty.ee9.webapp.WebAppContext`, with the addition of:
|
||||
|
||||
autoPreconfigure::
|
||||
(true/false).
|
||||
|
@ -108,7 +108,7 @@ Otherwise, create a context xml file with the following information (in addition
|
|||
|
||||
====== In Code
|
||||
|
||||
Create an instance of link:{JDURL}/org/eclipse/jetty/quickstart/QuickStartWebApp.html[`org.eclipse.jetty.quickstart.QuickStartWebApp`] rather than the normal `org.eclipse.jetty.webapp.WebAppContext`. You then use the QuickStartWebApp instance in exactly the same way that you would a WebAppContext.
|
||||
Create an instance of link:{JDURL}/org/eclipse/jetty/quickstart/QuickStartWebApp.html[`org.eclipse.jetty.quickstart.QuickStartWebApp`] rather than the normal `org.eclipse.jetty.ee9.webapp.WebAppContext`. You then use the QuickStartWebApp instance in exactly the same way that you would a WebAppContext.
|
||||
|
||||
Here's a snippet:
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
[[cgi-servlet-metadata]]
|
||||
==== Info
|
||||
|
||||
* Classname: `org.eclipse.jetty.servlets.CGI`
|
||||
* Classname: `org.eclipse.jetty.ee9.servlets.CGI`
|
||||
* Maven Artifact: org.eclipse.jetty:jetty-servlets
|
||||
* Javadoc: {JDURL}/org/eclipse/jetty/servlets/CGI.html
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
[[cross-origin-filter-metadata]]
|
||||
==== Info
|
||||
|
||||
* Classname: `org.eclipse.jetty.servlets.CrossOriginFilter`
|
||||
* Classname: `org.eclipse.jetty.ee9.servlets.CrossOriginFilter`
|
||||
* Maven Artifact: org.eclipse.jetty:jetty-servlets
|
||||
* Javadoc: {JDURL}/org/eclipse/jetty/servlets/CrossOriginFilter.html
|
||||
|
||||
|
@ -80,7 +80,7 @@ A typical configuration could be:
|
|||
|
||||
<filter>
|
||||
<filter-name>cross-origin</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
|
||||
<filter-class>org.eclipse.jetty.ee9.servlets.CrossOriginFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>cross-origin</filter-name>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
[[default-servlet-metadata]]
|
||||
==== Info
|
||||
|
||||
* Classname: `org.eclipse.jetty.servlet.DefaultServlet`
|
||||
* Classname: `org.eclipse.jetty.ee9.servlet.DefaultServlet`
|
||||
* Maven Artifact: org.eclipse.jetty:jetty-servlet
|
||||
* Javadoc: {JDURL}/org/eclipse/jetty/servlet/DefaultServlet.html
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
[[dos-filter-metadata]]
|
||||
==== Info
|
||||
|
||||
* Classname: `org.eclipse.jetty.servlets.DoSFilter`
|
||||
* Classname: `org.eclipse.jetty.ee9.servlets.DoSFilter`
|
||||
* Maven Artifact: org.eclipse.jetty:jetty-servlets
|
||||
* Javadoc: {JDURL}/org/eclipse/jetty/servlets/DoSFilter.html
|
||||
|
||||
|
@ -53,7 +53,7 @@ This example allow 30 requests at a time:
|
|||
----
|
||||
<filter>
|
||||
<filter-name>DoSFilter</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.DoSFilter</filter-class>
|
||||
<filter-class>org.eclipse.jetty.ee9.servlets.DoSFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>maxRequestsPerSec</param-name>
|
||||
<param-value>30</param-value>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
[[header-filter-metadata]]
|
||||
==== Info
|
||||
|
||||
* Classname: `org.eclipse.jetty.servlets.HeaderFilter`
|
||||
* Classname: `org.eclipse.jetty.ee9.servlets.HeaderFilter`
|
||||
* Maven Artifact: org.eclipse.jetty:jetty-servlets
|
||||
* Javadoc: {JDURL}/org/eclipse/jetty/servlets/HeaderFilter.html
|
||||
|
||||
|
@ -54,7 +54,7 @@ ____
|
|||
----
|
||||
<filter>
|
||||
<filter-name>HeaderFilter</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.HeaderFilter</filter-class>
|
||||
<filter-class>org.eclipse.jetty.ee9.servlets.HeaderFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>headerConfig</param-name>
|
||||
<param-value>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
[[qos-filter-metadata]]
|
||||
==== Info
|
||||
|
||||
* Classname: `org.eclipse.jetty.servlets.QoSFilter`
|
||||
* Classname: `org.eclipse.jetty.ee9.servlets.QoSFilter`
|
||||
* Maven Artifact: org.eclipse.jetty:jetty-servlets
|
||||
* Javadoc: {JDURL}/org/eclipse/jetty/servlets/QoSFilter.html
|
||||
|
||||
|
@ -82,7 +82,7 @@ This example processes fifty requests at a time:
|
|||
----
|
||||
<filter>
|
||||
<filter-name>QoSFilter</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.QoSFilter</filter-class>
|
||||
<filter-class>org.eclipse.jetty.ee9.servlets.QoSFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>maxRequests</param-name>
|
||||
<param-value>50</param-value>
|
||||
|
|
|
@ -41,11 +41,11 @@ For FastCGI there is no web application that needs developed - all the work has
|
|||
As such you only need to deploy a Jetty context XML file that configures the web application directly.
|
||||
Copy and paste the following content as `$JETTY_BASE/webapps/jetty-wordpress.xml`:
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
[source,xml,subs="{sub-order}"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
|
||||
<Configure class="org.eclipse.jetty.ee9.servlet.ServletContextHandler">
|
||||
|
||||
<New id="root" class="java.lang.String">
|
||||
<Arg>/var/www/wordpress</Arg>
|
||||
|
@ -58,7 +58,7 @@ Copy and paste the following content as `$JETTY_BASE/webapps/jetty-wordpress.xml
|
|||
</Set>
|
||||
|
||||
<Call name="addFilter">
|
||||
<Arg>org.eclipse.jetty.fcgi.server.proxy.TryFilesFilter</Arg>
|
||||
<Arg>org.eclipse.jetty.ee9.fcgi.server.proxy.TryFilesFilterorg.eclipse.jetty.ee9.fcgi.server.proxy.TryFilesFilter</Arg>
|
||||
<Arg>/*</Arg>
|
||||
<Arg>
|
||||
<Call name="of" class="java.util.EnumSet">
|
||||
|
@ -73,11 +73,11 @@ Copy and paste the following content as `$JETTY_BASE/webapps/jetty-wordpress.xml
|
|||
|
||||
<Call name="addServlet">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.servlet.ServletHolder">
|
||||
<New class="org.eclipse.jetty.ee9.servlet.ServletHolder">
|
||||
<Arg>default</Arg>
|
||||
<Arg>
|
||||
<Call name="forName" class="java.lang.Class">
|
||||
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
|
||||
<Arg>org.eclipse.jetty.ee9.servlet.DefaultServlet</Arg>
|
||||
</Call>
|
||||
</Arg>
|
||||
<Call name="setInitParameter">
|
||||
|
|
|
@ -33,12 +33,12 @@ The Jetty distribution come with several CDI modules.
|
|||
These modules do not provide CDI, but instead enable one of more integration mechanisms.
|
||||
|
||||
===== Jetty `cdi` Module
|
||||
The `cdi` module supports either two modes of CDI integration which can be selected either by the "org.eclipse.jetty.cdi" context init parameter or the "org.eclipse.jetty.cdi" server attribute (which is initialised from the "jetty.cdi.mode" start property).
|
||||
The `cdi` module supports either two modes of CDI integration which can be selected either by the "org.eclipse.jetty.ee9.cdi" context init parameter or the "org.eclipse.jetty.ee9.cdi" server attribute (which is initialised from the "jetty.cdi.mode" start property).
|
||||
Supported modes are:
|
||||
|
||||
* `CdiSpiDecorator` Jetty will call the CDI SPI within the webapp to decorate objects (default).
|
||||
|
||||
* `CdiDecoratingLister` The webapp may register a decorator on the context attribute "org.eclipse.jetty.cdi.decorator".
|
||||
* `CdiDecoratingLister` The webapp may register a decorator on the context attribute "org.eclipse.jetty.ee9.cdi.decorator".
|
||||
-------------------------
|
||||
cd $JETTY_BASE
|
||||
java -jar $JETTY_HOME/start.jar --add-to-start=cdi
|
||||
|
@ -74,7 +74,7 @@ This module is equivalent to directly modifying the class path configuration wit
|
|||
-------------------------------------------------------------
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Call name="prependServerClass">
|
||||
<Arg>-org.eclipse.jetty.util.Decorator</Arg>
|
||||
</Call>
|
||||
|
@ -88,7 +88,7 @@ This module is equivalent to directly modifying the class path configuration wit
|
|||
<Arg>-org.eclipse.jetty.server.handler.ContextHandler</Arg>
|
||||
</Call>
|
||||
<Call name="prependServerClass">
|
||||
<Arg>-org.eclipse.jetty.servlet.ServletContextHandler</Arg>
|
||||
<Arg>-org.eclipse.jetty.ee9.servlet.ServletContextHandler</Arg>
|
||||
</Call>
|
||||
</Configure>
|
||||
-------------------------------------------------------------
|
||||
|
|
|
@ -115,7 +115,7 @@ Here's how you would specify it:
|
|||
+
|
||||
[source, plain, subs="{sub-order}"]
|
||||
----
|
||||
jetty.home.bundle=org.eclipse.jetty.osgi.boot
|
||||
jetty.home.bundle=org.eclipse.jetty.ee9.osgi.boot
|
||||
----
|
||||
|
||||
+
|
||||
|
@ -357,7 +357,7 @@ Here's an example of the contents of a `META-INF/jetty-webapp-context.xml` file:
|
|||
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="defaultsDescriptor"><Property name="bundle.root"/>META-INF/webdefault.xml</Set>
|
||||
</Configure>
|
||||
----
|
||||
|
@ -440,7 +440,7 @@ include::{SRCDIR}/jetty-osgi/test-jetty-osgi-context/src/main/context/acme.xml[]
|
|||
[[services-as-webapps]]
|
||||
==== Deploying Services as Webapps
|
||||
|
||||
In addition to listening for bundles whose format or `MANIFEST` entries define a webapp or `ContextHandler` for to be deployed, the Jetty OSGi container also listens for the registration of OSGi services that are instances of `org.eclipse.jetty.webapp.WebAppContext`.
|
||||
In addition to listening for bundles whose format or `MANIFEST` entries define a webapp or `ContextHandler` for to be deployed, the Jetty OSGi container also listens for the registration of OSGi services that are instances of `org.eclipse.jetty.ee9.webapp.WebAppContext`.
|
||||
So you may programmatically create a `WebAppContext`, register it as a service, and have Jetty pick it up and deploy it.
|
||||
|
||||
Here's an example of doing that with a simple bundle that serves static content, and an `org.osgi.framework.BundleActivator` that instantiates the `WebAppContext`:
|
||||
|
@ -679,7 +679,7 @@ Here is the list of recommended jars (NOTE the version numbers may change in fut
|
|||
|org.eclipse.jdt.core.compiler.batch |Distribution lib/apache-jsp
|
||||
|
||||
|org.eclipse.jetty.osgi:jetty-osgi-boot-jsp
|
||||
|org.eclipse.jetty.osgi.boot.jsp
|
||||
|org.eclipse.jetty.ee9.osgi.boot.jsp
|
||||
|https://repo1.maven.org/maven2/org/eclipse/jetty/osgi/jetty-osgi-boot-jsp[Maven central]
|
||||
|=======================================================================
|
||||
|
||||
|
@ -748,15 +748,15 @@ The format of the *Require-TldBundle* header is a comma separated list of one or
|
|||
|
||||
Some TLD jars are required to be found on the Jetty OSGi container's classpath, rather than considered part of the web bundle's classpath.
|
||||
For example, this is true of JSTL and Java Server Faces.
|
||||
The Jetty OSGi container takes care of JSTL for you, but you can control which other jars are considered as part of the container's classpath by using the System property **org.eclipse.jetty.osgi.tldbundles**:
|
||||
The Jetty OSGi container takes care of JSTL for you, but you can control which other jars are considered as part of the container's classpath by using the System property **org.eclipse.jetty.ee9.osgi.tldbundles**:
|
||||
|
||||
org.eclipse.jetty.osgi.tldbundles::
|
||||
org.eclipse.jetty.ee9.osgi.tldbundles::
|
||||
System property defined on the OSGi environment that is a comma separated list of symbolic names of bundles containing taglibs that will be treated as if they are on the container's classpath for web bundles.
|
||||
For example:
|
||||
+
|
||||
[source, plain, subs="{sub-order}"]
|
||||
----
|
||||
org.eclipse.jetty.osgi.tldbundles=com.acme.special.tags,com.foo.web,org.bar.web.framework
|
||||
org.eclipse.jetty.ee9.osgi.tldbundles=com.acme.special.tags,com.foo.web,org.bar.web.framework
|
||||
----
|
||||
+
|
||||
You will still need to define the *Import-Bundle* header in the `MANIFEST` file for the web bundle to ensure that the TLD bundles are on the OSGi classpath.
|
||||
|
|
|
@ -201,7 +201,7 @@ To set the contextPath from within the WAR file, you can include a `WEB-INF/jett
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/contextpath</Set>
|
||||
</Configure>
|
||||
----
|
||||
|
@ -214,7 +214,7 @@ Instead of allowing the WAR file to be discovered by the deployer, an IoC XML fi
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test.war</Set>
|
||||
<Set name="contextPath">/test</Set>
|
||||
</Configure>
|
||||
|
|
|
@ -69,9 +69,9 @@ $ cd demo-base/
|
|||
2017-09-20 16:23:04.306:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@371a67ec{/async-rest,[file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-async-rest.war-_async-rest-any-5319296087878801290.dir/webapp/, jar:file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-async-rest.war-_async-rest-any-5319296087878801290.dir/webapp/WEB-INF/lib/example-async-rest-jar-{VERSION}.jar!/META-INF/resources],AVAILABLE}{/async-rest.war}
|
||||
2017-09-20 16:23:04.429:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=53ms
|
||||
2017-09-20 16:23:04.432:WARN::main: test webapp is deployed. DO NOT USE IN PRODUCTION!
|
||||
2017-09-20 16:23:04.511:INFO:oejsh.ManagedAttributeListener:main: update PushFilter null->org.eclipse.jetty.servlets.PushCacheFilter@2362f559 on o.e.j.w.WebAppContext@35e2d654{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-6279588879522983394.dir/webapp/,STARTING}{/test.war}
|
||||
2017-09-20 16:23:04.516:INFO:oejsh.ManagedAttributeListener:main: update QoSFilter null->org.eclipse.jetty.servlets.QoSFilter@7770f470 on o.e.j.w.WebAppContext@35e2d654{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-6279588879522983394.dir/webapp/,STARTING}{/test.war}
|
||||
2017-09-20 16:23:04.519:WARN:oeju.DeprecationWarning:main: Using @Deprecated Class org.eclipse.jetty.servlets.MultiPartFilter
|
||||
2017-09-20 16:23:04.511:INFO:oejsh.ManagedAttributeListener:main: update PushFilter null->org.eclipse.jetty.ee9.servlets.PushCacheFilter@2362f559 on o.e.j.w.WebAppContext@35e2d654{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-6279588879522983394.dir/webapp/,STARTING}{/test.war}
|
||||
2017-09-20 16:23:04.516:INFO:oejsh.ManagedAttributeListener:main: update QoSFilter null->org.eclipse.jetty.ee9.servlets.QoSFilter@7770f470 on o.e.j.w.WebAppContext@35e2d654{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-6279588879522983394.dir/webapp/,STARTING}{/test.war}
|
||||
2017-09-20 16:23:04.519:WARN:oeju.DeprecationWarning:main: Using @Deprecated Class org.eclipse.jetty.ee9.servlets.MultiPartFilter
|
||||
2017-09-20 16:23:04.549:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@35e2d654{/test,file:///private/var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/jetty-0.0.0.0-8080-test.war-_test-any-6279588879522983394.dir/webapp/,AVAILABLE}{/test.war}
|
||||
2017-09-20 16:23:04.646:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=12ms
|
||||
2017-09-20 16:23:04.649:WARN::main: test-jndi webapp is deployed. DO NOT USE IN PRODUCTION!
|
||||
|
|
|
@ -32,7 +32,7 @@ HTTP/2 Push can be automated in your application by configuring a link:{JDURL}/o
|
|||
...
|
||||
<filter>
|
||||
<filter-name>PushFilter</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.PushCacheFilter</filter-class>
|
||||
<filter-class>org.eclipse.jetty.ee9.servlets.PushCacheFilter</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
|
|
|
@ -23,7 +23,7 @@ You define global naming resources on the server via `jetty.xml`.
|
|||
[[jetty-env-root-element]]
|
||||
==== jetty-env.xml Root Element
|
||||
|
||||
Jetty applies `jetty-env.xml` on a per-webapp basis, and configures an instance of `org.eclipse.jetty.webapp.WebAppContext.`
|
||||
Jetty applies `jetty-env.xml` on a per-webapp basis, and configures an instance of `org.eclipse.jetty.ee9.webapp.WebAppContext.`
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
|
@ -31,7 +31,7 @@ Jetty applies `jetty-env.xml` on a per-webapp basis, and configures an instance
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
..
|
||||
</Configure>
|
||||
|
||||
|
@ -54,7 +54,7 @@ Place the `jetty-env.xml` file in your web application's WEB-INF folder.
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<!-- Add an EnvEntry only valid for this webapp -->
|
||||
<New id="gargle" class="org.eclipse.jetty.plus.jndi.EnvEntry">
|
||||
|
|
|
@ -23,14 +23,14 @@ For a more in-depth look at the syntax, see xref:jetty-xml-syntax[].
|
|||
[[root-element-jetty-web-xml]]
|
||||
==== Root Element
|
||||
|
||||
`jetty-web.xml` applies on a per-webapp basis, and configures an instance of `org.eclipse.jetty.webapp.WebAppContext`.
|
||||
`jetty-web.xml` applies on a per-webapp basis, and configures an instance of `org.eclipse.jetty.ee9.webapp.WebAppContext`.
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_9_3.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
..
|
||||
</Configure>
|
||||
----
|
||||
|
|
|
@ -31,7 +31,7 @@ For example, if you had a webapp named MyApp, you would place a deployable xml f
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
...
|
||||
<!-- Set up the path to the custom override descriptor,
|
||||
relative to your $(jetty.home) directory or to the current directory -->
|
||||
|
@ -44,7 +44,7 @@ The equivalent in code is:
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
|
||||
...
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ You can specify a custom `webdefault.xml` for an individual web application in t
|
|||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
...
|
||||
<!-- Set up the absolute path to the custom webdefault.xml -->
|
||||
<Set name="defaultsDescriptor">/my/path/to/webdefault.xml</Set>
|
||||
|
@ -72,7 +72,7 @@ The equivalent in code is:
|
|||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
|
||||
...
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ This example configures it as scoped to a web app with the id of __wac__:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New id="myds" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>jdbc/myds</Arg>
|
||||
|
@ -164,7 +164,7 @@ Here is an example of binding an http://activemq.apache.org[ActiveMQ] in-JVM con
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New id="cf" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid='wac'/></Arg>
|
||||
<Arg>jms/connectionFactory</Arg>
|
||||
|
@ -197,7 +197,7 @@ Jetty also provides infrastructure for access to `javax.mail.Sessions` from with
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New id="mail" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>mail/Session</Arg>
|
||||
|
@ -259,7 +259,7 @@ In a context xml file:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New id="myds" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>jdbc/mydatasource</Arg>
|
||||
|
@ -295,7 +295,7 @@ In a context xml file declare `jdbc/mydatasource`:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New id="myds" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>jdbc/mydatasource</Arg>
|
||||
|
|
|
@ -38,7 +38,7 @@ We'll use some mocked up classes for the transaction manager and the DataSource
|
|||
----
|
||||
import java.util.Properties;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
* ServerWithJNDI
|
||||
|
@ -54,8 +54,8 @@ public class ServerWithJNDI
|
|||
Server server = new Server(8080);
|
||||
|
||||
//Enable parsing of jndi-related parts of web.xml and jetty-env.xml
|
||||
org.eclipse.jetty.webapp.Configuration.ClassList classlist = org.eclipse.jetty.webapp.Configuration.ClassList.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
org.eclipse.jetty.ee9.webapp.Configuration.ClassList classlist = org.eclipse.jetty.ee9.webapp.Configuration.ClassList.setServerDefault(server);
|
||||
classlist.addAfter("org.eclipse.jetty.ee9.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration");
|
||||
|
||||
//Create a WebApp
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
|
|
|
@ -125,7 +125,7 @@ For example:
|
|||
+
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New id="cf" class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid='wac'/></Arg> <!-- reference to WebAppContext -->
|
||||
<Arg>jms/connectionFactory</Arg>
|
||||
|
|
|
@ -52,14 +52,14 @@ Alternatively, you can manually wire in the appropriate ServletContainerInitiali
|
|||
You can either follow the instructions on precompilation provided by Apache, or if you are using Maven for your builds, you can use the link:#jetty-jspc-maven-plugin[jetty-jspc-maven] plugin to do it for you.
|
||||
|
||||
If you have precompiled your JSPs, and have customized the output package prefix (which is `org.apache.jsp` by default), you should configure your webapp context to tell Jetty about this custom package name.
|
||||
You can do this using a servlet context init-param called `org.eclipse.jetty.servlet.jspPackagePrefix`.
|
||||
You can do this using a servlet context init-param called `org.eclipse.jetty.ee9.servlet.jspPackagePrefix`.
|
||||
|
||||
For example, suppose you have precompiled your JSPs with the custom package prefix of `com.acme`, then you would add the following lines to your `web.xml` file:
|
||||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<context-param>
|
||||
<param-name>org.eclipse.jetty.servlet.jspPackagePrefix</param-name>
|
||||
<param-name>org.eclipse.jetty.ee9.servlet.jspPackagePrefix</param-name>
|
||||
<param-value>com.acme</param-value>
|
||||
</context-param>
|
||||
----
|
||||
|
@ -206,7 +206,7 @@ If you are using the Jetty distribution, and you want to change the JSP settings
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/foo</Set>
|
||||
<Set name="war"><Property name="jetty.home" default="."/>/webapps/foobar.war</Set>
|
||||
<Set name="defaultsDescriptor">/home/smith/dev/webdefault.xml</Set>
|
||||
|
|
|
@ -60,11 +60,11 @@ By default, `jetty-runner` implements all Configuration Classes so that users ca
|
|||
If you wish to only implement certain Configuration Classes, they will need to be defined in the context xml for the webapp/context.
|
||||
The default Configuration Classes are:
|
||||
|
||||
`org.eclipse.jetty.webapp.WebInfConfiguration`
|
||||
`org.eclipse.jetty.webapp.WebXmlConfiguration`
|
||||
`org.eclipse.jetty.webapp.MetaInfConfiguration`
|
||||
`org.eclipse.jetty.webapp.FragmentConfiguration`
|
||||
`org.eclipse.jetty.webapp.JettyWebXmlConfiguration`
|
||||
`org.eclipse.jetty.ee9.webapp.WebInfConfiguration`
|
||||
`org.eclipse.jetty.ee9.webapp.WebXmlConfiguration`
|
||||
`org.eclipse.jetty.ee9.webapp.MetaInfConfiguration`
|
||||
`org.eclipse.jetty.ee9.webapp.FragmentConfiguration`
|
||||
`org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration`
|
||||
`org.eclipse.jetty.plus.webapp.EnvConfiguration`
|
||||
`org.eclipse.jetty.plus.webapp.PlusConfiguration`
|
||||
`org.eclipse.jetty.annotations.AnnotationConfiguration`
|
||||
|
|
|
@ -149,7 +149,7 @@ Here's an example of doing both of these, using a link:#deployable-descriptor-fi
|
|||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Get name="securityHandler">
|
||||
<!-- Either: -->
|
||||
<Set name="loginService">
|
||||
|
@ -174,7 +174,7 @@ Here's how to define the same HashLoginService, but inside a link:#deployable-de
|
|||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/test</Set>
|
||||
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test</Set>
|
||||
<Get name="securityHandler">
|
||||
|
@ -467,7 +467,7 @@ In the example below, a `HashLoginService` is defined with authorization being g
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure id="testWebapp" class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id="testWebapp" class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Get name="securityHandler">
|
||||
<Set name="realmName">Test Realm</Set>
|
||||
<Set name="authMethod">BASIC</Set>
|
||||
|
|
|
@ -36,7 +36,7 @@ These methods may be called directly when embedding Jetty, but more commonly are
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
...
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ An example:
|
|||
+
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
|
||||
<Set name="securityHandler">
|
||||
<New class="org.eclipse.jetty.security.ConstraintSecurityHandler">
|
||||
|
|
|
@ -49,7 +49,7 @@ Add the following to your context xml file:
|
|||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<Call name="setInitParameter">
|
||||
<Arg>org.eclipse.jetty.servlet.Default.useFileMappedBuffer</Arg>
|
||||
<Arg>org.eclipse.jetty.ee9.servlet.Default.useFileMappedBuffer</Arg>
|
||||
<Arg>false</Arg>
|
||||
</Call>
|
||||
----
|
||||
|
@ -63,7 +63,7 @@ Add the following to the plugin's configuration under the `<webApp>` element:
|
|||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<_initParams>
|
||||
<org.eclipse.jetty.servlet.Default.useFileMappedBuffer>false</org.eclipse.jetty.servlet.Default.useFileMappedBuffer>
|
||||
<org.eclipse.jetty.ee9.servlet.Default.useFileMappedBuffer>false</org.eclipse.jetty.ee9.servlet.Default.useFileMappedBuffer>
|
||||
</_initParams>
|
||||
----
|
||||
|
||||
|
@ -77,7 +77,7 @@ Configure this in an xml file like so:
|
|||
|
||||
[source, xml, subs="{sub-order}"]
|
||||
----
|
||||
<New id="myWebAppContext" class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<New id="myWebAppContext" class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/</Set>
|
||||
<Set name="war">./webapps/fredapp</Set>
|
||||
<Set name="copyWebDir">true</Set>
|
||||
|
|
|
@ -73,4 +73,4 @@ Other uses for a `JettyWebSocketCreator`:
|
|||
* Obtaining the Servlet HttpSession object (if it exists)
|
||||
* Specifying a response status code and reason
|
||||
|
||||
If you don't want to accept the upgrade, simply return null from the link:{JDURL}/org/eclipse/jetty/websocket/servlet/JettyWebSocketCreator.html#createWebSocket(org.eclipse.jetty.websocket.api.UpgradeRequest,org.eclipse.jetty.websocket.api.UpgradeResponse)[`JettyWebSocketCreator.createWebSocket(UpgradeRequest req, UpgradeResponse resp)`] method.
|
||||
If you don't want to accept the upgrade, simply return null from the link:{JDURL}/org/eclipse/jetty/websocket/servlet/JettyWebSocketCreator.html#createWebSocket(org.eclipse.jetty.ee9.websocket.api.UpgradeRequest,org.eclipse.jetty.ee9.websocket.api.UpgradeResponse)[`JettyWebSocketCreator.createWebSocket(UpgradeRequest req, UpgradeResponse resp)`] method.
|
||||
|
|
|
@ -50,7 +50,7 @@ Here's an example context xml file that calls this method:
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <1>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Set name="configurationDiscovered">false</Set> <2>
|
||||
</Configure>
|
||||
----
|
||||
|
@ -78,7 +78,7 @@ Here's an example from a context xml file that includes any jar whose name start
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <1>
|
||||
<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>
|
||||
|
@ -108,7 +108,7 @@ Here's an example of a context xml file that sets a pattern that matches any jar
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <1>
|
||||
<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>
|
||||
|
@ -174,7 +174,7 @@ Here's an example of setting the context attribute in a context xml file:
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <1>
|
||||
<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>
|
||||
|
@ -205,7 +205,7 @@ Here is an example context xml file that ensures the `com.example.PrioritySCI` w
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <1>
|
||||
<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>
|
||||
|
|
|
@ -42,7 +42,7 @@ mywebapp.war
|
|||
<1> Publicly accessible resources such as `+*.html+`, `+*.jsp+`, `+*.css+`, `+*.js+` files, etc. are placed in `+*.war+` or in sub-directories of the `+*.war+`.
|
||||
<2> `WEB-INF` is a special directory used to store anything related to the web application that must not be publicly accessible, but may be accessed by other resources.
|
||||
<3> `WEB-INF/classes` stores the web application compiled `+*.class+` files
|
||||
<4> `WEB-INF/lib` stores the web application `+*.jar+` files
|
||||
<4> `WEB-INF/classes` stores the web application `+*.jar+` files
|
||||
<5> `WEB-INF/web.xml` is the web application deployment descriptor defines the components and the configuration of your web application.
|
||||
====
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ If you do not want Jetty to extract the `+*.war+` files, you can disable this fe
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
<Set name="extractWAR">false</Set>
|
||||
|
|
|
@ -28,7 +28,7 @@ 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://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <1>
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <1>
|
||||
<Set name="contextPath">/wiki</Set> <2>
|
||||
<Set name="war">/opt/myapps/myapp.war</Set> <3>
|
||||
</Configure>
|
||||
|
@ -62,7 +62,7 @@ You can use the features of xref:og-xml[Jetty XML files] to avoid to hard-code f
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/wiki</Set>
|
||||
<Set name="war"><SystemProperty name="myapps.dir"/>/myapp.war</Set>
|
||||
</Configure>
|
||||
|
|
|
@ -23,7 +23,7 @@ The JNDI entry must be _defined_ in a xref:og-jndi-xml[Jetty XML file], for exam
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure id="wac" class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id="wac" class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
# <New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
|
|
|
@ -24,7 +24,7 @@ This allows you to add host specific configuration or server specific configurat
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
<Set name="overrideDescriptor">/opt/webapps/mywebapp-web.xml</Set>
|
||||
|
|
|
@ -58,7 +58,7 @@ If you have a web application `mywebapp.war` you can configure its virtual hosts
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/mywebapp</Set>
|
||||
<Set name="war">/opt/webapps/mywebapp.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
|
@ -103,7 +103,7 @@ To achieve this, you simply use the same context path of `/` for each of your we
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/</Set>
|
||||
<Set name="war">/opt/webapps/domain.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
|
@ -120,7 +120,7 @@ To achieve this, you simply use the same context path of `/` for each of your we
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/</Set>
|
||||
<Set name="war">/opt/webapps/hobby.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
|
@ -148,7 +148,7 @@ In this case, you want to xref:og-protocols[configure multiple connectors], each
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/</Set>
|
||||
<Set name="war">/opt/webapps/domain.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
|
@ -165,7 +165,7 @@ In this case, you want to xref:og-protocols[configure multiple connectors], each
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">/</Set>
|
||||
<Set name="war">/opt/webapps/hobby.war</Set>
|
||||
<Set name="virtualHosts">
|
||||
|
|
|
@ -115,7 +115,7 @@ Here's an example of this type of XML file:
|
|||
----
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="securityHandler">
|
||||
<New class="org.eclipse.jetty.security.ConstraintSecurityHandler">
|
||||
<Set name="loginService">
|
||||
|
|
|
@ -120,7 +120,7 @@ In this example, we'll configure a link:http://db.apache.org/derby[Derby] DataSo
|
|||
|
||||
[source,xml,subs=verbatim]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>jdbc/myds</Arg>
|
||||
|
@ -166,7 +166,7 @@ Here is an example of binding an link:http://activemq.apache.org[ActiveMQ] in-JV
|
|||
|
||||
[source,xml,subs=verbatim]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid='wac'/></Arg>
|
||||
<Arg>jms/connectionFactory</Arg>
|
||||
|
@ -202,7 +202,7 @@ To configure access to `javax.mail.Session` from within a webapp, declare an `or
|
|||
|
||||
[source,xml,subs=verbatim]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>mail/Session</Arg>
|
||||
|
@ -277,7 +277,7 @@ The context XML file declares `jdbc/workforce`:
|
|||
|
||||
[source,xml,subs=verbatim]
|
||||
----
|
||||
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure id='wac' class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<New class="org.eclipse.jetty.plus.jndi.Resource">
|
||||
<Arg><Ref refid="wac"/></Arg>
|
||||
<Arg>jdbc/workforce</Arg>
|
||||
|
@ -374,7 +374,7 @@ For example:
|
|||
<1> We refer to the id `Server` which identifies the default `org.eclipse.jetty.server.Server` instance.
|
||||
|
||||
*Webapp scope:*
|
||||
The name is unique to the `org.eclipse.jetty.webapp.WebAppContext` instance, and is only visible to that application.
|
||||
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]
|
||||
|
@ -389,4 +389,4 @@ For example:
|
|||
</Arg>
|
||||
</New>
|
||||
----
|
||||
<1> We refer to an instance of an `org.eclipse.jetty.webapp.WebAppContext` which has been previously defined.
|
||||
<1> We refer to an instance of an `org.eclipse.jetty.ee9.webapp.WebAppContext` which has been previously defined.
|
||||
|
|
|
@ -197,7 +197,7 @@ Here's an example of using a context xml file to add in a pattern to match files
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <!--1-->
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext"> <!--1-->
|
||||
<Call name="setAttribute"> <!--2-->
|
||||
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> <!--3-->
|
||||
<Arg>.*/jetty-servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$|.*/jsf-[^/]*\.jar$</Arg> <!--4-->
|
||||
|
|
|
@ -22,7 +22,7 @@ Below is an example of how you could configure a the xref:og-session-filesystem[
|
|||
|
||||
[source,xml]
|
||||
----
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Call id="sh" name="getSessionHandler">
|
||||
<Set name="sessionCache">
|
||||
<New class="org.eclipse.jetty.server.session.DefaultSessionCache">
|
||||
|
|
|
@ -351,7 +351,7 @@ For example, you may want to configure the context path of your web application
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Configure class="org.eclipse.jetty.ee9.webapp.WebAppContext">
|
||||
<Set name="contextPath">
|
||||
#<Property name="com.myapps.mywiki.context.path" default="/wiki" />#
|
||||
</Set>
|
||||
|
|
|
@ -156,12 +156,9 @@ The dynamic transport, however, has been implemented to support multiple transpo
|
|||
include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPClientDocs.java[tag=dynamicH1H2]
|
||||
----
|
||||
|
||||
NOTE: The order in which the protocols are specified to `HttpClientTransportDynamic` indicates what is the client preference.
|
||||
|
||||
IMPORTANT: When using TLS (i.e. URIs with the `https` scheme), the application protocol is _negotiated_ between client and server via ALPN, and it is the server that decides what is the application protocol to use for the communication, regardless of the client preference.
|
||||
|
||||
When clear-text communication is used (i.e. URIs with the `http` scheme) there is no application protocol negotiation, and therefore the application must know _a priori_ whether the server supports the protocol or not.
|
||||
For example, if the server only supports clear-text HTTP/2, and `HttpClientTransportDynamic` is configured as in the example above, the client will send, by default, a clear-text HTTP/1.1 request to a clear-text HTTP/2 only server, which will result in a communication failure.
|
||||
IMPORTANT: The order in which the protocols are specified to `HttpClientTransportDynamic` indicates what is the client preference.
|
||||
If the protocol is negotiated via ALPN, it is the server that decides what is the protocol to use for the communication, regardless of the client preference.
|
||||
If the protocol is not negotiated, the client preference is honored.
|
||||
|
||||
Provided that the server supports both HTTP/1.1 and HTTP/2 clear-text, client applications can explicitly hint the version they want to use:
|
||||
|
||||
|
@ -170,13 +167,13 @@ Provided that the server supports both HTTP/1.1 and HTTP/2 clear-text, client ap
|
|||
include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/http/HTTPClientDocs.java[tag=dynamicClearText]
|
||||
----
|
||||
|
||||
In case of TLS encrypted communication using the `https` scheme, things are a little more complicated.
|
||||
In case of TLS encrypted communication using the HTTPS scheme, things are a little more complicated.
|
||||
|
||||
If the client application explicitly specifies the HTTP version, then ALPN is not used by the client.
|
||||
If the client application explicitly specifies the HTTP version, then ALPN is not used on the client.
|
||||
By specifying the HTTP version explicitly, the client application has prior-knowledge of what HTTP version the server supports, and therefore ALPN is not needed.
|
||||
If the server does not support the HTTP version chosen by the client, then the communication will fail.
|
||||
|
||||
If the client application does not explicitly specify the HTTP version, then ALPN will be used by the client.
|
||||
If the client application does not explicitly specify the HTTP version, then ALPN will be used on the client.
|
||||
If the server also supports ALPN, then the protocol will be negotiated via ALPN and the server will choose the protocol to use.
|
||||
If the server does not support ALPN, the client will try to use the first protocol configured in `HttpClientTransportDynamic`, and the communication may succeed or fail depending on whether the server supports the protocol chosen by the client.
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ The Maven artifact coordinates are the following:
|
|||
[[pg-client-websocket-start]]
|
||||
==== Starting WebSocketClient
|
||||
|
||||
The main class is `org.eclipse.jetty.websocket.client.WebSocketClient`; you instantiate it, configure it, and then start it like may other Jetty components.
|
||||
The main class is `org.eclipse.jetty.ee9.websocket.client.WebSocketClient`; you instantiate it, configure it, and then start it like may other Jetty components.
|
||||
This is a minimal example:
|
||||
|
||||
[source,java,indent=0]
|
||||
|
@ -119,7 +119,7 @@ In code:
|
|||
include::../../{doc_code}/org/eclipse/jetty/docs/programming/client/websocket/WebSocketClientDocs.java[tags=connectHTTP11]
|
||||
----
|
||||
|
||||
`WebSocketClient.connect()` links the client-side WebSocket _endpoint_ to a specific server URI, and returns a `CompletableFuture` of an `org.eclipse.jetty.websocket.api.Session`.
|
||||
`WebSocketClient.connect()` links the client-side WebSocket _endpoint_ to a specific server URI, and returns a `CompletableFuture` of an `org.eclipse.jetty.ee9.websocket.api.Session`.
|
||||
|
||||
The endpoint offers APIs to _receive_ WebSocket data (or errors) from the server, while the session offers APIs to _send_ WebSocket data to the server.
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ Here is an example, which turns on scanning for changes every ten seconds, and s
|
|||
===== Configuration
|
||||
|
||||
webApp::
|
||||
This is an instance of link:{javadoc-url}/org/eclipse/jetty/maven/plugin/MavenWebAppContext.html[org.eclipse.jetty.maven.plugin.MavenWebAppContext], which is an extension to the class link:{javadoc-url}/org/eclipse/jetty/webapp/WebAppContext.hml[`org.eclipse.jetty.webapp.WebAppContext`].
|
||||
This is an instance of link:{javadoc-url}/org/eclipse/jetty/maven/plugin/MavenWebAppContext.html[org.eclipse.jetty.maven.plugin.MavenWebAppContext], which is an extension to the class link:{javadoc-url}/org/eclipse/jetty/webapp/WebAppContext.hml[`org.eclipse.jetty.ee9.webapp.WebAppContext`].
|
||||
You can use any of the setter methods on this object to configure your webapp.
|
||||
Here are a few of the most useful ones:
|
||||
+
|
||||
|
@ -565,7 +565,7 @@ This goal will generate output from jetty into the `target/jetty-start.out` file
|
|||
These configuration parameters are available:
|
||||
|
||||
webApp::
|
||||
This is an instance of link:{javadoc-url}/org/eclipse/jetty/maven/plugin/MavenWebAppContext.html[org.eclipse.jetty.maven.plugin.MavenWebAppContext], which is an extension to the class link:{javadoc-url}/org/eclipse/jetty/webapp/WebAppContext.hml[`org.eclipse.jetty.webapp.WebAppContext`].
|
||||
This is an instance of link:{javadoc-url}/org/eclipse/jetty/maven/plugin/MavenWebAppContext.html[org.eclipse.jetty.maven.plugin.MavenWebAppContext], which is an extension to the class link:{javadoc-url}/org/eclipse/jetty/webapp/WebAppContext.hml[`org.eclipse.jetty.ee9.webapp.WebAppContext`].
|
||||
You can use any of the setter methods on this object to configure your webapp.
|
||||
Here are a few of the most useful ones:
|
||||
+
|
||||
|
@ -1032,7 +1032,7 @@ Putting the configuration in webapp A's `pom.xml`:
|
|||
|
||||
[IMPORTANT]
|
||||
====
|
||||
If the `ContextHandler` you are deploying is a webapp, it is *essential* that you use an `org.eclipse.jetty.maven.plugin.MavenWebAppContext` instance rather than a standard `org.eclipse.jetty.webapp.WebAppContext` instance.
|
||||
If the `ContextHandler` you are deploying is a webapp, it is *essential* that you use an `org.eclipse.jetty.maven.plugin.MavenWebAppContext` instance rather than a standard `org.eclipse.jetty.ee9.webapp.WebAppContext` instance.
|
||||
Only the former will allow the webapp to function correctly in the maven environment.
|
||||
====
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ Web applications cannot downcast Servlet's `HttpServletRequest` to Jetty's `Requ
|
|||
|
||||
Lastly, the Servlet specification requires that other classes, also called _system classes_, such as `javax.servlet.http.HttpServletRequest` or JDK classes such as `java.lang.String` or `java.sql.Connection` cannot be modified by web applications by putting, for example, modified versions of those classes in `WEB-INF/classes` so that they are loaded first by the web application class loader (instead of the class-path class loader where they are normally loaded from).
|
||||
|
||||
`WebAppContext` implements this class loader logic using a single class loader, `org.eclipse.jetty.webapp.WebAppClassLoader`, with filtering capabilities: when it loads a class, it checks whether the class is a _system class_ or a _server class_ and acts according to the Servlet specification.
|
||||
`WebAppContext` implements this class loader logic using a single class loader, `org.eclipse.jetty.ee9.webapp.WebAppClassLoader`, with filtering capabilities: when it loads a class, it checks whether the class is a _system class_ or a _server class_ and acts according to the Servlet specification.
|
||||
|
||||
When `WebAppClassLoader` is asked to load a class, it first tries to find the class locally (since it must use the inverted child-first model); if the class is found, and it is not a _system class_, the class is loaded; otherwise the class is not found locally.
|
||||
If the class is not found locally, the parent class loader is asked to load the class; the parent class loader uses the standard parent-first model, so it delegates the class loading to its parent, and so on.
|
||||
|
|
|
@ -110,23 +110,23 @@ This event is converted to a call to `AbstractConnection.onFillable()`, where th
|
|||
|
||||
The parser emit events that are protocol specific; the HTTP/2 parser, for example, emits events for each HTTP/2 frame that has been parsed, and similarly does the HTTP/3 parser.
|
||||
The parser events are then converted to protocol independent events such as _"request start"_, _"request headers"_, _"request content chunk"_, etc.
|
||||
that in turn are converted into method calls to `HttpChannel`.
|
||||
that in turn are converted into method calls to `HttpChannelState`.
|
||||
|
||||
When enough of the HTTP request is arrived, the `Connection` calls `HttpChannel.handle()` that calls the `Handler` chain, that eventually calls the server application code.
|
||||
|
||||
[[pg-server-http-channel-events]]
|
||||
===== HttpChannel Events
|
||||
|
||||
The central component processing HTTP requests is `HttpChannel`.
|
||||
There is a 1-to-1 relationship between an HTTP request/response and an `HttpChannel`, no matter what is the specific protocol that carries the HTTP request over the network (HTTP/1.1, HTTP/2, HTTP/3 or FastCGI).
|
||||
The central component processing HTTP requests is `HttpChannelState`.
|
||||
There is a 1-to-1 relationship between an HTTP request/response and an `HttpChannelState`, no matter what is the specific protocol that carries the HTTP request over the network (HTTP/1.1, HTTP/2, HTTP/3 or FastCGI).
|
||||
|
||||
Advanced server applications may be interested in the progress of the processing of an HTTP request/response by `HttpChannel`.
|
||||
Advanced server applications may be interested in the progress of the processing of an HTTP request/response by `HttpChannelState`.
|
||||
A typical case is to know exactly _when_ the HTTP request/response processing is complete, for example to monitor processing times.
|
||||
|
||||
NOTE: A `Handler` or a Servlet `Filter` may not report precisely when an HTTP request/response processing is finished.
|
||||
A server application may write a small enough content that is aggregated by Jetty for efficiency reasons; the write returns immediately, but nothing has been written to the network yet.
|
||||
|
||||
`HttpChannel` notifies ``HttpChannel.Listener``s of the progress of the HTTP request/response handling.
|
||||
`HttpChannelState` notifies ``HttpChannel.Listener``s of the progress of the HTTP request/response handling.
|
||||
Currently, the following events are available:
|
||||
|
||||
* `requestBegin`
|
||||
|
|
|
@ -27,7 +27,7 @@ checkingRemoteSessionIdEncoding::
|
|||
Boolean, default `false`.
|
||||
This controls whether or not the `javax.servlet.http.Response.encodeURL(String)` method will include the session id as a path parameter when the URL is destined for a remote node.
|
||||
This can also be configured by:
|
||||
* setting the `org.eclipse.jetty.servlet.CheckingRemoteSessionIdEncoding` context init paramter
|
||||
* setting the `org.eclipse.jetty.ee9.servlet.CheckingRemoteSessionIdEncoding` context init paramter
|
||||
|
||||
setMaxInactiveInterval::
|
||||
Integer, seconds.
|
||||
|
@ -69,14 +69,14 @@ This is the name of the session cookie.
|
|||
It can alternatively be configured by:
|
||||
|
||||
* using `javax.servlet.SessionCookieConfig.setName(String)` method
|
||||
* setting the `org.eclipse.jetty.servlet.SessionCookie` context init parameter.
|
||||
* setting the `org.eclipse.jetty.ee9.servlet.SessionCookie` context init parameter.
|
||||
|
||||
sessionIdPathParameterName::
|
||||
String, default is `jsessionid`.
|
||||
This is the name of the path parameter used to transmit the session id on request URLs, and on encoded URLS in responses.
|
||||
It can alternatively be configured by:
|
||||
|
||||
* setting the `org.eclipse.jetty.servlet.SessionIdPathParameterName` context init parameter
|
||||
* setting the `org.eclipse.jetty.ee9.servlet.SessionIdPathParameterName` context init parameter
|
||||
|
||||
sessionTrackingModes::
|
||||
`Set<javax.servlet.SessionTrackingMode>`.
|
||||
|
@ -99,7 +99,7 @@ This can also be configured by:
|
|||
There are also a few session settings that do not have SessionHandler setters, but can be configured with context init parameters:
|
||||
|
||||
[[pg-server-session-handler-maxAge]]
|
||||
org.eclipse.jetty.servlet.MaxAge::
|
||||
org.eclipse.jetty.ee9.servlet.MaxAge::
|
||||
This is the maximum number of seconds that the session cookie will be considered to be valid.
|
||||
By default, the cookie has no maximum validity time.
|
||||
See also xref:pg-server-session-handler-refreshcookie[refreshing the session cookie].
|
||||
|
@ -107,7 +107,7 @@ The value can also be configured by:
|
|||
|
||||
* calling the `SessionCookieConfig.setMaxAge(int)` method.
|
||||
|
||||
org.eclipse.jetty.servlet.SessionDomain::
|
||||
org.eclipse.jetty.ee9.servlet.SessionDomain::
|
||||
String, default `null`.
|
||||
This is the domain of the session cookie.
|
||||
This can also be configured by:
|
||||
|
@ -115,7 +115,7 @@ This can also be configured by:
|
|||
* using the `javax.servlet.SessionCookieConfig.setDomain(String)` method
|
||||
* defining the `<session-config><cookie-config><domain/></cookie-config></session-config>` element in `web.xml`
|
||||
|
||||
org.eclipse.jetty.servlet.SessionPath::
|
||||
org.eclipse.jetty.ee9.servlet.SessionPath::
|
||||
String, default `null`.
|
||||
This is used when creating a new session cookie.
|
||||
If nothing is configured, the context path is used instead, defaulting to `/`.
|
||||
|
|
|
@ -44,7 +44,7 @@ For example:
|
|||
<!-- The CrossOriginFilter *must* be the first --> <!--1-->
|
||||
<filter>
|
||||
<filter-name>cross-origin</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
|
||||
<filter-class>org.eclipse.jetty.ee9.servlets.CrossOriginFilter</filter-class>
|
||||
<async-supported>true</async-supported>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
|
|
|
@ -76,7 +76,7 @@ Calling `JettyWebSocketServletContainerInitializer.configure(\...)` must be done
|
|||
|
||||
Once you have xref:pg-server-websocket-jetty-container[setup] the `JettyWebSocketServerContainer`, you can configure your xref:pg-websocket-endpoints[WebSocket endpoints].
|
||||
|
||||
Differently from the xref:pg-server-websocket-standard-endpoints[configuration of standard WebSocket endpoints], WebSocket endpoint classes may be annotated with Jetty WebSocket API annotations, or extend the `org.eclipse.jetty.websocket.api.WebSocketListener` interface, but they are not automatically discovered, not even when deploying web applications using xref:pg-server-http-handler-use-webapp-context[`WebAppContext`].
|
||||
Differently from the xref:pg-server-websocket-standard-endpoints[configuration of standard WebSocket endpoints], WebSocket endpoint classes may be annotated with Jetty WebSocket API annotations, or extend the `org.eclipse.jetty.ee9.websocket.api.WebSocketListener` interface, but they are not automatically discovered, not even when deploying web applications using xref:pg-server-http-handler-use-webapp-context[`WebAppContext`].
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
|
|
|
@ -57,7 +57,7 @@ Applications interested in this type of messages receive a `byte[]` representing
|
|||
[[pg-websocket-endpoints-listener]]
|
||||
===== Listener Endpoints
|
||||
|
||||
A WebSocket endpoint may implement the `org.eclipse.jetty.websocket.api.WebSocketListener` interface to receive WebSocket events:
|
||||
A WebSocket endpoint may implement the `org.eclipse.jetty.ee9.websocket.api.WebSocketListener` interface to receive WebSocket events:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
|
@ -70,7 +70,7 @@ include::{doc_code}/org/eclipse/jetty/docs/programming/WebSocketDocs.java[tags=l
|
|||
If you need to deal with large WebSocket messages, you may reduce the memory usage by streaming the message content.
|
||||
For large WebSocket messages, the memory usage may be large due to the fact that the text or the bytes must be accumulated until the message is complete before delivering the message event.
|
||||
|
||||
To stream textual or binary messages, you must implement interface `org.eclipse.jetty.websocket.api.WebSocketPartialListener` instead of `WebSocketListener`.
|
||||
To stream textual or binary messages, you must implement interface `org.eclipse.jetty.ee9.websocket.api.WebSocketPartialListener` instead of `WebSocketListener`.
|
||||
|
||||
Interface `WebSocketPartialListener` exposes one method for textual messages, and one method to binary messages that receive _chunks_ of, respectively, text and bytes that form the whole WebSocket message.
|
||||
|
||||
|
@ -84,7 +84,7 @@ include::{doc_code}/org/eclipse/jetty/docs/programming/WebSocketDocs.java[tags=s
|
|||
[[pg-websocket-endpoints-annotated]]
|
||||
===== Annotated Endpoints
|
||||
|
||||
A WebSocket endpoint may annotate methods with `org.eclipse.jetty.websocket.api.annotations.*` annotations to receive WebSocket events.
|
||||
A WebSocket endpoint may annotate methods with `org.eclipse.jetty.ee9.websocket.api.annotations.*` annotations to receive WebSocket events.
|
||||
Each annotated method may take an optional `Session` argument as its first parameter:
|
||||
|
||||
[source,java,indent=0]
|
||||
|
@ -144,7 +144,7 @@ A WebSocket session is the entity that offers an API to send data to the remote
|
|||
[[pg-websocket-session-configure]]
|
||||
===== Configuring the Session
|
||||
|
||||
You may configure the WebSocket session behavior using the `org.eclipse.jetty.websocket.api.Session` APIs.
|
||||
You may configure the WebSocket session behavior using the `org.eclipse.jetty.ee9.websocket.api.Session` APIs.
|
||||
You want to do this as soon as you have access to the `Session` object, typically from the xref:pg-websocket-endpoints[_connect_ event] handler:
|
||||
|
||||
[source,java,indent=0]
|
||||
|
@ -254,7 +254,7 @@ The WebSocket protocol defines two special frame, named `Ping` and `Pong` that m
|
|||
* Calculate the round-trip time with the remote peer.
|
||||
* Keep the connection from being closed due to idle timeout -- a heartbeat-like mechanism.
|
||||
|
||||
To handle `Ping`/`Pong` events, you may implement interface `org.eclipse.jetty.websocket.api.WebSocketPingPongListener`.
|
||||
To handle `Ping`/`Pong` events, you may implement interface `org.eclipse.jetty.ee9.websocket.api.WebSocketPingPongListener`.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
|
|
|
@ -20,19 +20,19 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.file.Path;
|
||||
import java.time.Duration;
|
||||
|
||||
import org.eclipse.jetty.ee9.websocket.api.RemoteEndpoint;
|
||||
import org.eclipse.jetty.ee9.websocket.api.Session;
|
||||
import org.eclipse.jetty.ee9.websocket.api.StatusCode;
|
||||
import org.eclipse.jetty.ee9.websocket.api.WebSocketListener;
|
||||
import org.eclipse.jetty.ee9.websocket.api.WebSocketPartialListener;
|
||||
import org.eclipse.jetty.ee9.websocket.api.WebSocketPingPongListener;
|
||||
import org.eclipse.jetty.ee9.websocket.api.WriteCallback;
|
||||
import org.eclipse.jetty.ee9.websocket.api.annotations.OnWebSocketClose;
|
||||
import org.eclipse.jetty.ee9.websocket.api.annotations.OnWebSocketConnect;
|
||||
import org.eclipse.jetty.ee9.websocket.api.annotations.OnWebSocketError;
|
||||
import org.eclipse.jetty.ee9.websocket.api.annotations.OnWebSocketMessage;
|
||||
import org.eclipse.jetty.ee9.websocket.api.annotations.WebSocket;
|
||||
import org.eclipse.jetty.util.IteratingCallback;
|
||||
import org.eclipse.jetty.websocket.api.RemoteEndpoint;
|
||||
import org.eclipse.jetty.websocket.api.Session;
|
||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketListener;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPartialListener;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPingPongListener;
|
||||
import org.eclipse.jetty.websocket.api.WriteCallback;
|
||||
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
|
||||
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect;
|
||||
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError;
|
||||
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
|
||||
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class WebSocketDocs
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.eclipse.jetty.http.HttpHeader;
|
|||
import org.eclipse.jetty.http.HttpURI;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.http.MetaData;
|
||||
import org.eclipse.jetty.http2.ErrorCode;
|
||||
import org.eclipse.jetty.http2.api.Session;
|
||||
import org.eclipse.jetty.http2.api.Stream;
|
||||
import org.eclipse.jetty.http2.client.HTTP2Client;
|
||||
|
@ -35,6 +34,7 @@ import org.eclipse.jetty.http2.frames.HeadersFrame;
|
|||
import org.eclipse.jetty.http2.frames.PushPromiseFrame;
|
||||
import org.eclipse.jetty.http2.frames.ResetFrame;
|
||||
import org.eclipse.jetty.http2.frames.SettingsFrame;
|
||||
import org.eclipse.jetty.http2.internal.ErrorCode;
|
||||
import org.eclipse.jetty.io.ClientConnector;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
||||
|
|
|
@ -22,14 +22,14 @@ import org.eclipse.jetty.client.HttpProxy;
|
|||
import org.eclipse.jetty.client.HttpRequest;
|
||||
import org.eclipse.jetty.client.HttpResponse;
|
||||
import org.eclipse.jetty.client.dynamic.HttpClientTransportDynamic;
|
||||
import org.eclipse.jetty.ee9.websocket.api.Session;
|
||||
import org.eclipse.jetty.ee9.websocket.client.ClientUpgradeRequest;
|
||||
import org.eclipse.jetty.ee9.websocket.client.JettyUpgradeListener;
|
||||
import org.eclipse.jetty.ee9.websocket.client.WebSocketClient;
|
||||
import org.eclipse.jetty.http2.client.HTTP2Client;
|
||||
import org.eclipse.jetty.http2.client.http.ClientConnectionFactoryOverHTTP2;
|
||||
import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2;
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
import org.eclipse.jetty.websocket.api.Session;
|
||||
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.client.JettyUpgradeListener;
|
||||
import org.eclipse.jetty.websocket.client.WebSocketClient;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class WebSocketClientDocs
|
||||
|
|
|
@ -27,6 +27,12 @@ import jakarta.servlet.http.HttpServlet;
|
|||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
|
||||
import org.eclipse.jetty.ee9.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.ee9.servlet.FilterHolder;
|
||||
import org.eclipse.jetty.ee9.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee9.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.ee9.servlets.CrossOriginFilter;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.http.HttpCompliance;
|
||||
import org.eclipse.jetty.http.HttpHeaderValue;
|
||||
import org.eclipse.jetty.http.HttpMethod;
|
||||
|
@ -42,7 +48,6 @@ import org.eclipse.jetty.rewrite.handler.RewriteHandler;
|
|||
import org.eclipse.jetty.rewrite.handler.RewriteRegexRule;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.CustomRequestLog;
|
||||
import org.eclipse.jetty.server.HttpChannel;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
import org.eclipse.jetty.server.ProxyConnectionFactory;
|
||||
|
@ -65,18 +70,13 @@ import org.eclipse.jetty.server.handler.ResourceHandler;
|
|||
import org.eclipse.jetty.server.handler.SecuredRedirectHandler;
|
||||
import org.eclipse.jetty.server.handler.StatisticsHandler;
|
||||
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.FilterHolder;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.servlets.CrossOriginFilter;
|
||||
import org.eclipse.jetty.server.internal.HttpChannelState;
|
||||
import org.eclipse.jetty.unixdomain.server.UnixDomainServerConnector;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class HTTPServerDocs
|
|||
public void httpChannelListener() throws Exception
|
||||
{
|
||||
// tag::httpChannelListener[]
|
||||
class TimingHttpChannelListener implements HttpChannel.Listener
|
||||
class TimingHttpChannelListener implements HttpChannelState.Listener
|
||||
{
|
||||
private final ConcurrentMap<Request, Long> times = new ConcurrentHashMap<>();
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.jetty.http.HttpStatus;
|
|||
import org.eclipse.jetty.http.HttpURI;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.http.MetaData;
|
||||
import org.eclipse.jetty.http2.ErrorCode;
|
||||
import org.eclipse.jetty.http2.api.Session;
|
||||
import org.eclipse.jetty.http2.api.Stream;
|
||||
import org.eclipse.jetty.http2.api.server.ServerSessionListener;
|
||||
|
@ -33,6 +32,7 @@ import org.eclipse.jetty.http2.frames.HeadersFrame;
|
|||
import org.eclipse.jetty.http2.frames.PushPromiseFrame;
|
||||
import org.eclipse.jetty.http2.frames.ResetFrame;
|
||||
import org.eclipse.jetty.http2.frames.SettingsFrame;
|
||||
import org.eclipse.jetty.http2.internal.ErrorCode;
|
||||
import org.eclipse.jetty.http2.server.RawHTTP2ServerConnectionFactory;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
|
|
|
@ -16,25 +16,25 @@ package org.eclipse.jetty.docs.programming.server.session;
|
|||
import java.io.File;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import org.eclipse.jetty.ee9.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.memcached.session.MemcachedSessionDataMapFactory;
|
||||
import org.eclipse.jetty.nosql.mongodb.MongoSessionDataStoreFactory;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.server.session.CachingSessionDataStoreFactory;
|
||||
import org.eclipse.jetty.server.session.DatabaseAdaptor;
|
||||
import org.eclipse.jetty.server.session.DefaultSessionCache;
|
||||
import org.eclipse.jetty.server.session.DefaultSessionCacheFactory;
|
||||
import org.eclipse.jetty.server.session.DefaultSessionIdManager;
|
||||
import org.eclipse.jetty.server.session.FileSessionDataStore;
|
||||
import org.eclipse.jetty.server.session.FileSessionDataStoreFactory;
|
||||
import org.eclipse.jetty.server.session.HouseKeeper;
|
||||
import org.eclipse.jetty.server.session.NullSessionCache;
|
||||
import org.eclipse.jetty.server.session.NullSessionCacheFactory;
|
||||
import org.eclipse.jetty.server.session.NullSessionDataStore;
|
||||
import org.eclipse.jetty.server.session.SessionCache;
|
||||
import org.eclipse.jetty.server.session.SessionHandler;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.session.CachingSessionDataStoreFactory;
|
||||
import org.eclipse.jetty.session.DatabaseAdaptor;
|
||||
import org.eclipse.jetty.session.DefaultSessionCache;
|
||||
import org.eclipse.jetty.session.DefaultSessionCacheFactory;
|
||||
import org.eclipse.jetty.session.DefaultSessionIdManager;
|
||||
import org.eclipse.jetty.session.FileSessionDataStore;
|
||||
import org.eclipse.jetty.session.FileSessionDataStoreFactory;
|
||||
import org.eclipse.jetty.session.HouseKeeper;
|
||||
import org.eclipse.jetty.session.NullSessionCache;
|
||||
import org.eclipse.jetty.session.NullSessionCacheFactory;
|
||||
import org.eclipse.jetty.session.NullSessionDataStore;
|
||||
import org.eclipse.jetty.session.SessionCache;
|
||||
import org.eclipse.jetty.session.SessionHandler;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class SessionDocs
|
||||
|
@ -114,7 +114,7 @@ public class SessionDocs
|
|||
//EVICT_ON_INACTIVE: evict a session after 60sec inactivity
|
||||
cacheFactory.setEvictionPolicy(60);
|
||||
//Only useful with the EVICT_ON_INACTIVE policy
|
||||
cacheFactory.setSaveOnInactiveEvict(true);
|
||||
cacheFactory.setSaveOnInactiveEviction(true);
|
||||
cacheFactory.setFlushOnResponseCommit(true);
|
||||
cacheFactory.setInvalidateOnShutdown(false);
|
||||
cacheFactory.setRemoveUnloadableSessions(true);
|
||||
|
|
|
@ -24,16 +24,16 @@ import jakarta.websocket.DeploymentException;
|
|||
import jakarta.websocket.server.ServerContainer;
|
||||
import jakarta.websocket.server.ServerEndpoint;
|
||||
import jakarta.websocket.server.ServerEndpointConfig;
|
||||
import org.eclipse.jetty.ee9.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee9.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.ee9.websocket.api.annotations.WebSocket;
|
||||
import org.eclipse.jetty.ee9.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee9.websocket.server.JettyWebSocketCreator;
|
||||
import org.eclipse.jetty.ee9.websocket.server.JettyWebSocketServerContainer;
|
||||
import org.eclipse.jetty.ee9.websocket.server.JettyWebSocketServlet;
|
||||
import org.eclipse.jetty.ee9.websocket.server.JettyWebSocketServletFactory;
|
||||
import org.eclipse.jetty.ee9.websocket.server.config.JettyWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
|
||||
import org.eclipse.jetty.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.websocket.server.JettyWebSocketCreator;
|
||||
import org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer;
|
||||
import org.eclipse.jetty.websocket.server.JettyWebSocketServlet;
|
||||
import org.eclipse.jetty.websocket.server.JettyWebSocketServletFactory;
|
||||
import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class WebSocketServerDocs
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
<version>12.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.documentation</groupId>
|
||||
<artifactId>documentation-parent</artifactId>
|
||||
<artifactId>documentation</artifactId>
|
||||
<name>Jetty :: Documentation :: Parent</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>11.0.10-SNAPSHOT</version>
|
||||
<version>12.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -14,6 +14,7 @@
|
|||
<properties>
|
||||
<sources-directory>${project.build.directory}/jetty-sources</sources-directory>
|
||||
<sonar.skip>true</sonar.skip>
|
||||
<pmd.skip>true</pmd.skip>
|
||||
<spotbugs.skip>true</spotbugs.skip>
|
||||
<checkstyle.skip>true</checkstyle.skip>
|
||||
</properties>
|
||||
|
@ -108,10 +109,6 @@
|
|||
infinispan-remote,
|
||||
jetty-test-helper,
|
||||
alpn-api,
|
||||
quic-quiche,
|
||||
quic-quiche-common,
|
||||
quic-quiche-foreign-incubator,
|
||||
quic-quiche-jna,
|
||||
javax.servlet,
|
||||
javax.websocket,
|
||||
jakarta.servlet,
|
||||
|
@ -157,6 +154,8 @@
|
|||
org.eclipse.jetty.http3.qpack.internal.*;
|
||||
org.eclipse.jetty.http3.server.internal;
|
||||
org.eclipse.jetty.quic.common.internal;
|
||||
org.eclipse.jetty.quic.quiche;
|
||||
org.eclipse.jetty.quic.quiche.*;
|
||||
org.eclipse.jetty.quic.server.internal;
|
||||
</excludePackageNames>
|
||||
</configuration>
|
||||
|
@ -347,11 +346,6 @@
|
|||
<artifactId>jetty-unixsocket-client</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-unixsocket-server</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-jakarta-server</artifactId>
|
||||
|
@ -400,12 +394,6 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jspc-maven-plugin</artifactId>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
org.eclipse.jetty.annotations.AnnotationConfiguration
|
|
@ -1,44 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
|
||||
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.client;
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
import org.eclipse.jetty.client.api.ContentProvider;
|
||||
import org.eclipse.jetty.client.api.Request;
|
||||
|
||||
/**
|
||||
* A {@link ContentProvider} that notifies listeners that content is available.
|
||||
*
|
||||
* @deprecated no replacement, use {@link Request.Content} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface AsyncContentProvider extends ContentProvider
|
||||
{
|
||||
/**
|
||||
* @param listener the listener to be notified of content availability
|
||||
*/
|
||||
public void setListener(Listener listener);
|
||||
|
||||
/**
|
||||
* A listener that is notified of content availability
|
||||
*/
|
||||
public interface Listener extends EventListener
|
||||
{
|
||||
/**
|
||||
* Callback method invoked when content is available
|
||||
*/
|
||||
public void onContent();
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
|
||||
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.client.api;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jetty.client.HttpClient;
|
||||
import org.eclipse.jetty.client.internal.RequestContentAdapter;
|
||||
import org.eclipse.jetty.client.util.ByteBufferContentProvider;
|
||||
import org.eclipse.jetty.client.util.PathContentProvider;
|
||||
|
||||
/**
|
||||
* <p>{@link ContentProvider} provides a source of request content.</p>
|
||||
* <p>Implementations should return an {@link Iterator} over the request content.
|
||||
* If the request content comes from a source that needs to be closed (for
|
||||
* example, an {@link java.io.InputStream}), then the iterator implementation class
|
||||
* must implement {@link Closeable} and will be closed when the request is
|
||||
* completed (either successfully or failed).</p>
|
||||
* <p>Applications should rely on utility classes such as {@link ByteBufferContentProvider}
|
||||
* or {@link PathContentProvider}.</p>
|
||||
* <p>{@link ContentProvider} provides a {@link #getLength() length} of the content
|
||||
* it represents.
|
||||
* If the length is positive, it typically overrides any {@code Content-Length}
|
||||
* header set by applications; if the length is negative, it typically removes
|
||||
* any {@code Content-Length} header set by applications, resulting in chunked
|
||||
* content (i.e. {@code Transfer-Encoding: chunked}) being sent to the server.</p>
|
||||
*
|
||||
* @deprecated use {@link Request.Content} instead, or {@link #toRequestContent(ContentProvider)}
|
||||
* to convert ContentProvider to {@link Request.Content}.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ContentProvider extends Iterable<ByteBuffer>
|
||||
{
|
||||
/**
|
||||
* <p>Converts a ContentProvider to a {@link Request.Content}.</p>
|
||||
*
|
||||
* @param provider the ContentProvider to convert
|
||||
* @return a {@link Request.Content} that wraps the ContentProvider
|
||||
*/
|
||||
public static Request.Content toRequestContent(ContentProvider provider)
|
||||
{
|
||||
return new RequestContentAdapter(provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the content length, if known, or -1 if the content length is unknown
|
||||
*/
|
||||
long getLength();
|
||||
|
||||
/**
|
||||
* <p>Whether this ContentProvider can produce exactly the same content more
|
||||
* than once.</p>
|
||||
* <p>Implementations should return {@code true} only if the content can be
|
||||
* produced more than once, which means that invocations to {@link #iterator()}
|
||||
* must return a new, independent, iterator instance over the content.</p>
|
||||
* <p>The {@link HttpClient} implementation may use this method in particular
|
||||
* cases where it detects that it is safe to retry a request that failed.</p>
|
||||
*
|
||||
* @return whether the content can be produced more than once
|
||||
*/
|
||||
default boolean isReproducible()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* An extension of {@link ContentProvider} that provides a content type string
|
||||
* to be used as a {@code Content-Type} HTTP header in requests.
|
||||
*
|
||||
* @deprecated use {@link Request.Content} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface Typed extends ContentProvider
|
||||
{
|
||||
/**
|
||||
* @return the content type string such as "application/octet-stream" or
|
||||
* "application/json;charset=UTF8", or null if no content type must be set
|
||||
*/
|
||||
public String getContentType();
|
||||
}
|
||||
}
|
|
@ -1,324 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
|
||||
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.client.internal;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.jetty.client.AsyncContentProvider;
|
||||
import org.eclipse.jetty.client.Synchronizable;
|
||||
import org.eclipse.jetty.client.api.ContentProvider;
|
||||
import org.eclipse.jetty.client.api.Request;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.util.thread.AutoLock;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* <p>Implements the conversion from {@link ContentProvider} to {@link Request.Content}.</p>
|
||||
*/
|
||||
public class RequestContentAdapter implements Request.Content, Request.Content.Subscription, AsyncContentProvider.Listener, Callback
|
||||
{
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RequestContentAdapter.class);
|
||||
|
||||
private final AutoLock lock = new AutoLock();
|
||||
private final ContentProvider provider;
|
||||
private Iterator<ByteBuffer> iterator;
|
||||
private Consumer consumer;
|
||||
private boolean emitInitialContent;
|
||||
private boolean lastContent;
|
||||
private boolean committed;
|
||||
private int demand;
|
||||
private boolean stalled;
|
||||
private boolean hasContent;
|
||||
private Throwable failure;
|
||||
|
||||
public RequestContentAdapter(ContentProvider provider)
|
||||
{
|
||||
this.provider = provider;
|
||||
if (provider instanceof AsyncContentProvider)
|
||||
((AsyncContentProvider)provider).setListener(this);
|
||||
}
|
||||
|
||||
public ContentProvider getContentProvider()
|
||||
{
|
||||
return provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentType()
|
||||
{
|
||||
return provider instanceof ContentProvider.Typed ? ((ContentProvider.Typed)provider).getContentType() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength()
|
||||
{
|
||||
return provider.getLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReproducible()
|
||||
{
|
||||
return provider.isReproducible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Subscription subscribe(Consumer consumer, boolean emitInitialContent)
|
||||
{
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
if (this.consumer != null && !isReproducible())
|
||||
throw new IllegalStateException("Multiple subscriptions not supported on " + this);
|
||||
this.iterator = provider.iterator();
|
||||
this.consumer = consumer;
|
||||
this.emitInitialContent = emitInitialContent;
|
||||
this.lastContent = false;
|
||||
this.committed = false;
|
||||
this.demand = 0;
|
||||
this.stalled = true;
|
||||
this.hasContent = false;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void demand()
|
||||
{
|
||||
boolean produce;
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
++demand;
|
||||
produce = stalled;
|
||||
if (stalled)
|
||||
stalled = false;
|
||||
}
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Content demand, producing {} for {}", produce, this);
|
||||
if (produce)
|
||||
produce();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fail(Throwable failure)
|
||||
{
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
if (this.failure == null)
|
||||
this.failure = failure;
|
||||
}
|
||||
failed(failure);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContent()
|
||||
{
|
||||
boolean produce = false;
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
hasContent = true;
|
||||
if (demand > 0)
|
||||
{
|
||||
produce = stalled;
|
||||
if (stalled)
|
||||
stalled = false;
|
||||
}
|
||||
}
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Content event, processing {} for {}", produce, this);
|
||||
if (produce)
|
||||
produce();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void succeeded()
|
||||
{
|
||||
if (iterator instanceof Callback)
|
||||
((Callback)iterator).succeeded();
|
||||
if (lastContent && iterator instanceof Closeable)
|
||||
IO.close((Closeable)iterator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failed(Throwable x)
|
||||
{
|
||||
if (iterator == null)
|
||||
failed(provider, x);
|
||||
else
|
||||
failed(iterator, x);
|
||||
}
|
||||
|
||||
private void failed(Object object, Throwable failure)
|
||||
{
|
||||
if (object instanceof Callback)
|
||||
((Callback)object).failed(failure);
|
||||
if (object instanceof Closeable)
|
||||
IO.close((Closeable)object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvocationType getInvocationType()
|
||||
{
|
||||
return InvocationType.NON_BLOCKING;
|
||||
}
|
||||
|
||||
private void produce()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Throwable failure;
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
failure = this.failure;
|
||||
}
|
||||
if (failure != null)
|
||||
{
|
||||
notifyFailure(failure);
|
||||
return;
|
||||
}
|
||||
|
||||
if (committed)
|
||||
{
|
||||
ByteBuffer content = advance();
|
||||
if (content != null)
|
||||
{
|
||||
notifyContent(content, lastContent);
|
||||
}
|
||||
else
|
||||
{
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
// Call to advance() said there was no content,
|
||||
// but some content may have arrived meanwhile.
|
||||
if (hasContent)
|
||||
{
|
||||
hasContent = false;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
stalled = true;
|
||||
}
|
||||
}
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("No content, processing stalled for {}", this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
committed = true;
|
||||
if (emitInitialContent)
|
||||
{
|
||||
ByteBuffer content = advance();
|
||||
if (content != null)
|
||||
notifyContent(content, lastContent);
|
||||
else
|
||||
notifyContent(BufferUtil.EMPTY_BUFFER, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
notifyContent(BufferUtil.EMPTY_BUFFER, false);
|
||||
}
|
||||
}
|
||||
boolean noDemand;
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
noDemand = demand == 0;
|
||||
if (noDemand)
|
||||
stalled = true;
|
||||
}
|
||||
if (noDemand)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("No demand, processing stalled for {}", this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ByteBuffer advance()
|
||||
{
|
||||
if (iterator instanceof Synchronizable)
|
||||
{
|
||||
synchronized (((Synchronizable)iterator).getLock())
|
||||
{
|
||||
return next();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return next();
|
||||
}
|
||||
}
|
||||
|
||||
private ByteBuffer next()
|
||||
{
|
||||
boolean hasNext = iterator.hasNext();
|
||||
ByteBuffer bytes = hasNext ? iterator.next() : null;
|
||||
boolean hasMore = hasNext && iterator.hasNext();
|
||||
lastContent = !hasMore;
|
||||
return hasNext ? bytes : BufferUtil.EMPTY_BUFFER;
|
||||
}
|
||||
|
||||
private void notifyContent(ByteBuffer buffer, boolean last)
|
||||
{
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
--demand;
|
||||
hasContent = false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Notifying content last={} {} for {}", last, BufferUtil.toDetailString(buffer), this);
|
||||
consumer.onContent(buffer, last, this);
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
fail(x);
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyFailure(Throwable failure)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Notifying failure for {}", this, failure);
|
||||
consumer.onFailure(failure);
|
||||
}
|
||||
catch (Exception x)
|
||||
{
|
||||
LOG.trace("Failure while notifying content failure {}", failure, x);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
int demand;
|
||||
boolean stalled;
|
||||
try (AutoLock ignored = lock.lock())
|
||||
{
|
||||
demand = this.demand;
|
||||
stalled = this.stalled;
|
||||
}
|
||||
return String.format("%s@%x[demand=%d,stalled=%b]", getClass().getSimpleName(), hashCode(), demand, stalled);
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
|
||||
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.client.util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.eclipse.jetty.client.api.ContentProvider;
|
||||
|
||||
/**
|
||||
* A {@link ContentProvider} for {@link ByteBuffer}s.
|
||||
* <p>
|
||||
* The position and limit of the {@link ByteBuffer}s passed to the constructor are not modified,
|
||||
* and each invocation of the {@link #iterator()} method returns a {@link ByteBuffer#slice() slice}
|
||||
* of the original {@link ByteBuffer}.
|
||||
*
|
||||
* @deprecated use {@link ByteBufferRequestContent} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class ByteBufferContentProvider extends AbstractTypedContentProvider
|
||||
{
|
||||
private final ByteBuffer[] buffers;
|
||||
private final int length;
|
||||
|
||||
public ByteBufferContentProvider(ByteBuffer... buffers)
|
||||
{
|
||||
this("application/octet-stream", buffers);
|
||||
}
|
||||
|
||||
public ByteBufferContentProvider(String contentType, ByteBuffer... buffers)
|
||||
{
|
||||
super(contentType);
|
||||
this.buffers = buffers;
|
||||
int length = 0;
|
||||
for (ByteBuffer buffer : buffers)
|
||||
{
|
||||
length += buffer.remaining();
|
||||
}
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReproducible()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ByteBuffer> iterator()
|
||||
{
|
||||
return new Iterator<ByteBuffer>()
|
||||
{
|
||||
private int index;
|
||||
|
||||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
return index < buffers.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuffer next()
|
||||
{
|
||||
try
|
||||
{
|
||||
ByteBuffer buffer = buffers[index];
|
||||
buffers[index] = buffer.slice();
|
||||
++index;
|
||||
return buffer;
|
||||
}
|
||||
catch (ArrayIndexOutOfBoundsException x)
|
||||
{
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
|
||||
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.client.util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.eclipse.jetty.client.api.ContentProvider;
|
||||
|
||||
/**
|
||||
* A {@link ContentProvider} for byte arrays.
|
||||
*
|
||||
* @deprecated use {@link BytesRequestContent} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class BytesContentProvider extends AbstractTypedContentProvider
|
||||
{
|
||||
private final byte[][] bytes;
|
||||
private final long length;
|
||||
|
||||
public BytesContentProvider(byte[]... bytes)
|
||||
{
|
||||
this("application/octet-stream", bytes);
|
||||
}
|
||||
|
||||
public BytesContentProvider(String contentType, byte[]... bytes)
|
||||
{
|
||||
super(contentType);
|
||||
this.bytes = bytes;
|
||||
long length = 0;
|
||||
for (byte[] buffer : bytes)
|
||||
{
|
||||
length += buffer.length;
|
||||
}
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReproducible()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ByteBuffer> iterator()
|
||||
{
|
||||
return new Iterator<ByteBuffer>()
|
||||
{
|
||||
private int index;
|
||||
|
||||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
return index < bytes.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuffer next()
|
||||
{
|
||||
try
|
||||
{
|
||||
return ByteBuffer.wrap(bytes[index++]);
|
||||
}
|
||||
catch (ArrayIndexOutOfBoundsException x)
|
||||
{
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,343 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
|
||||
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.client.util;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.eclipse.jetty.client.AsyncContentProvider;
|
||||
import org.eclipse.jetty.client.Synchronizable;
|
||||
import org.eclipse.jetty.client.api.ContentProvider;
|
||||
import org.eclipse.jetty.client.api.Request;
|
||||
import org.eclipse.jetty.client.api.Response;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
||||
/**
|
||||
* A {@link ContentProvider} that allows to add content after {@link Request#send(Response.CompleteListener)}
|
||||
* has been called, therefore providing the request content at a later time.
|
||||
* <p>
|
||||
* {@link DeferredContentProvider} can only be used in conjunction with
|
||||
* {@link Request#send(Response.CompleteListener)} (and not with its blocking counterpart {@link Request#send()})
|
||||
* because it provides content asynchronously.
|
||||
* <p>
|
||||
* The deferred content is provided once and then fully consumed.
|
||||
* Invocations to the {@link #iterator()} method after the first will return an "empty" iterator
|
||||
* because the stream has been consumed on the first invocation.
|
||||
* However, it is possible for subclasses to override {@link #offer(ByteBuffer)} and {@link #close()} to copy
|
||||
* the content to another location (for example a file) and be able to support multiple invocations
|
||||
* of of {@link #iterator()} returning the iterator provided by this
|
||||
* class on the first invocation, and an iterator on the bytes copied to the other location
|
||||
* for subsequent invocations.
|
||||
* <p>
|
||||
* Typical usage of {@link DeferredContentProvider} is in asynchronous proxies, where HTTP headers arrive
|
||||
* separately from HTTP content chunks.
|
||||
* <p>
|
||||
* The deferred content must be provided through {@link #offer(ByteBuffer)}, which can be invoked multiple
|
||||
* times, and when all content has been provided it must be signaled with a call to {@link #close()}.
|
||||
* <p>
|
||||
* Example usage:
|
||||
* <pre>
|
||||
* HttpClient httpClient = ...;
|
||||
*
|
||||
* // Use try-with-resources to autoclose DeferredContentProvider
|
||||
* try (DeferredContentProvider content = new DeferredContentProvider())
|
||||
* {
|
||||
* httpClient.newRequest("localhost", 8080)
|
||||
* .content(content)
|
||||
* .send(new Response.CompleteListener()
|
||||
* {
|
||||
* @Override
|
||||
* public void onComplete(Result result)
|
||||
* {
|
||||
* // Your logic here
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // At a later time...
|
||||
* content.offer(ByteBuffer.wrap("some content".getBytes()));
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @deprecated use {@link AsyncRequestContent} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DeferredContentProvider implements AsyncContentProvider, Callback, Closeable
|
||||
{
|
||||
private static final Chunk CLOSE = new Chunk(BufferUtil.EMPTY_BUFFER, Callback.NOOP);
|
||||
|
||||
private final Object lock = this;
|
||||
private final Deque<Chunk> chunks = new ArrayDeque<>();
|
||||
private final AtomicReference<Listener> listener = new AtomicReference<>();
|
||||
private final DeferredContentProviderIterator iterator = new DeferredContentProviderIterator();
|
||||
private final AtomicBoolean closed = new AtomicBoolean();
|
||||
private long length = -1;
|
||||
private int size;
|
||||
private Throwable failure;
|
||||
|
||||
/**
|
||||
* Creates a new {@link DeferredContentProvider} with the given initial content
|
||||
*
|
||||
* @param buffers the initial content
|
||||
*/
|
||||
public DeferredContentProvider(ByteBuffer... buffers)
|
||||
{
|
||||
for (ByteBuffer buffer : buffers)
|
||||
{
|
||||
offer(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListener(Listener listener)
|
||||
{
|
||||
if (!this.listener.compareAndSet(null, listener))
|
||||
throw new IllegalStateException(String.format("The same %s instance cannot be used in multiple requests",
|
||||
AsyncContentProvider.class.getName()));
|
||||
|
||||
if (isClosed())
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
long total = 0;
|
||||
for (Chunk chunk : chunks)
|
||||
{
|
||||
total += chunk.buffer.remaining();
|
||||
}
|
||||
length = total;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given content buffer to this content provider
|
||||
* and notifies the listener that content is available.
|
||||
*
|
||||
* @param buffer the content to add
|
||||
* @return true if the content was added, false otherwise
|
||||
*/
|
||||
public boolean offer(ByteBuffer buffer)
|
||||
{
|
||||
return offer(buffer, Callback.NOOP);
|
||||
}
|
||||
|
||||
public boolean offer(ByteBuffer buffer, Callback callback)
|
||||
{
|
||||
return offer(new Chunk(buffer, callback));
|
||||
}
|
||||
|
||||
private boolean offer(Chunk chunk)
|
||||
{
|
||||
Throwable failure;
|
||||
boolean result = false;
|
||||
synchronized (lock)
|
||||
{
|
||||
failure = this.failure;
|
||||
if (failure == null)
|
||||
{
|
||||
result = chunks.offer(chunk);
|
||||
if (result && chunk != CLOSE)
|
||||
++size;
|
||||
}
|
||||
}
|
||||
if (failure != null)
|
||||
chunk.callback.failed(failure);
|
||||
else if (result)
|
||||
notifyListener();
|
||||
return result;
|
||||
}
|
||||
|
||||
private void clear()
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
chunks.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void flush() throws IOException
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (failure != null)
|
||||
throw new IOException(failure);
|
||||
if (size == 0)
|
||||
break;
|
||||
lock.wait();
|
||||
}
|
||||
}
|
||||
catch (InterruptedException x)
|
||||
{
|
||||
throw new InterruptedIOException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* No more content will be added to this content provider
|
||||
* and notifies the listener that no more content is available.
|
||||
*/
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
if (closed.compareAndSet(false, true))
|
||||
offer(CLOSE);
|
||||
}
|
||||
|
||||
public boolean isClosed()
|
||||
{
|
||||
return closed.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failed(Throwable failure)
|
||||
{
|
||||
iterator.failed(failure);
|
||||
}
|
||||
|
||||
private void notifyListener()
|
||||
{
|
||||
Listener listener = this.listener.get();
|
||||
if (listener != null)
|
||||
listener.onContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ByteBuffer> iterator()
|
||||
{
|
||||
return iterator;
|
||||
}
|
||||
|
||||
private class DeferredContentProviderIterator implements Iterator<ByteBuffer>, Callback, Synchronizable
|
||||
{
|
||||
private Chunk current;
|
||||
|
||||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
return chunks.peek() != CLOSE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuffer next()
|
||||
{
|
||||
synchronized (lock)
|
||||
{
|
||||
Chunk chunk = current = chunks.poll();
|
||||
if (chunk == CLOSE)
|
||||
{
|
||||
// Slow path: reinsert the CLOSE chunk
|
||||
// so that hasNext() works correctly.
|
||||
chunks.offerFirst(CLOSE);
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
return chunk == null ? null : chunk.buffer;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void succeeded()
|
||||
{
|
||||
Chunk chunk;
|
||||
synchronized (lock)
|
||||
{
|
||||
chunk = current;
|
||||
current = null;
|
||||
if (chunk != null)
|
||||
{
|
||||
--size;
|
||||
lock.notify();
|
||||
}
|
||||
}
|
||||
if (chunk != null)
|
||||
chunk.callback.succeeded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failed(Throwable x)
|
||||
{
|
||||
List<Chunk> chunks = new ArrayList<>();
|
||||
synchronized (lock)
|
||||
{
|
||||
failure = x;
|
||||
// Transfer all chunks to fail them all.
|
||||
Chunk chunk = current;
|
||||
current = null;
|
||||
if (chunk != null)
|
||||
chunks.add(chunk);
|
||||
chunks.addAll(DeferredContentProvider.this.chunks);
|
||||
clear();
|
||||
lock.notify();
|
||||
}
|
||||
for (Chunk chunk : chunks)
|
||||
{
|
||||
chunk.callback.failed(x);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getLock()
|
||||
{
|
||||
return lock;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Chunk
|
||||
{
|
||||
public final ByteBuffer buffer;
|
||||
public final Callback callback;
|
||||
|
||||
public Chunk(ByteBuffer buffer, Callback callback)
|
||||
{
|
||||
this.buffer = Objects.requireNonNull(buffer);
|
||||
this.callback = Objects.requireNonNull(callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x", getClass().getSimpleName(), hashCode());
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue