diff --git a/standalone/deferred-deployment/README.md b/standalone/deferred-deployment/README.md index ba487c8..a0fbc33 100644 --- a/standalone/deferred-deployment/README.md +++ b/standalone/deferred-deployment/README.md @@ -13,12 +13,84 @@ The webapps in use on this jetty.base ## New Modules -There is a new `deploy-late` module present in this jetty.base in the `modules/deploy-late.mod`. +There are 4 new modules present in this jetty.base in the `modules/` directory. -This `deploy-late` module: +* `core-deploy-late` - a deployment app provider for `core` environment applications (based on default `core-deploy` module) +* `ee10-deploy-late` - a deployment app provider for `ee10` environment applications (based on default `ee10-deploy` module) +* `ee9-deploy-late` - a deployment app provider for `ee9` environment applications (based on default `ee9-deploy` module) +* `ee8-deploy-late` - a deployment app provider for `ee8` environment applications (based on default `ee8-deploy` module) -* provides a Jetty Deployment AppProvider that monitors for deployable +We are going to use only one of these modules for purposes of this example. + +This `ee10-deploy-late` module: + +* provides a Jetty Deployment AppProvider that monitors for deployable `ee10` content in the `${jetty.base}/webapps-late/` directory. * has `deferInitialDeploy` configuration set to `true` -This module is enabled via the `start.d/deploy-late.ini`. \ No newline at end of file +This module is enabled via the `start.d/ee10-deploy-late.ini` file. + + +## Testing Deployment + +You can make requests to 2 different URLs and look at the output. + +``` shell +$ curl -vvv http://localhost:8080/appB/ +* Trying 127.0.0.1:8080... +* Connected to localhost (127.0.0.1) port 8080 (#0) +> GET /appB/ HTTP/1.1 +> Host: localhost:8080 +> User-Agent: curl/7.81.0 +> Accept: */* +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 200 OK +< Server: Jetty(12.0.10) +< Last-Modified: Wed, 26 Jun 2024 15:27:42 GMT +< Content-Type: text/html +< Accept-Ranges: bytes +< Content-Length: 173 +< + + + Webapp B + + + +

WebApp B

+

You've reached WebApp B

+ + +* Connection #0 to host localhost left intact +``` + +This shows that `/appB/` is responding with the `index.html` + +Now lets request `/appB/dyncss/main.css` ... + +``` shell +$ curl -vvv http://localhost:8080/appB/dyncss/main.css +* Trying 127.0.0.1:8080... +* Connected to localhost (127.0.0.1) port 8080 (#0) +> GET /appB/dyncss/main.css HTTP/1.1 +> Host: localhost:8080 +> User-Agent: curl/7.81.0 +> Accept: */* +> +* Mark bundle as not supporting multiuse +< HTTP/1.1 200 OK +< Server: Jetty(12.0.10) +< Content-Type: text/css;charset=utf-8 +< Content-Length: 82 +< +// This is the main.css from Web Application A + +body { + text-style: sans-serif; +} +* Connection #0 to host localhost left intact +``` + +We can see that requesting content from `/appB/` is instead showing content from `/appA/` +that was requested by `appB` during the startup of that webapp. \ No newline at end of file diff --git a/standalone/deferred-deployment/etc/jetty-core-deploy-late.xml b/standalone/deferred-deployment/etc/jetty-core-deploy-late.xml index 94f79ce..8001be0 100644 --- a/standalone/deferred-deployment/etc/jetty-core-deploy-late.xml +++ b/standalone/deferred-deployment/etc/jetty-core-deploy-late.xml @@ -19,7 +19,7 @@ - + true diff --git a/standalone/deferred-deployment/etc/jetty-ee10-deploy-late.xml b/standalone/deferred-deployment/etc/jetty-ee10-deploy-late.xml index 4706097..b641805 100644 --- a/standalone/deferred-deployment/etc/jetty-ee10-deploy-late.xml +++ b/standalone/deferred-deployment/etc/jetty-ee10-deploy-late.xml @@ -1,59 +1,48 @@ - - - org.eclipse.jetty.deploy.DeploymentManager - - - - contextHandlerClass - - - - - - - - ee10 - - - - - - - - - jetty.deploy.defaultsDescriptorPath - jetty.deploy.defaultsDescriptor - - /etc/webdefault-ee10.xml - + + + + + ee10 + + + + + + + + + jetty.deploy.defaultsDescriptorPath + jetty.deploy.defaultsDescriptor + + /etc/webdefault-ee10.xml + + + + true + + + + + + + + .*/jakarta.servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-.*\.jar$ - - true - - - - - - - - .*/jakarta.servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-.*\.jar$ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/standalone/deferred-deployment/etc/jetty-ee8-deploy-late.xml b/standalone/deferred-deployment/etc/jetty-ee8-deploy-late.xml index 839a724..f6ea6d4 100644 --- a/standalone/deferred-deployment/etc/jetty-ee8-deploy-late.xml +++ b/standalone/deferred-deployment/etc/jetty-ee8-deploy-late.xml @@ -1,59 +1,48 @@ - - - org.eclipse.jetty.deploy.DeploymentManager - - - - contextHandlerClass - - - - - - - - ee8 - - - - - - - - - jetty.deploy.defaultsDescriptorPath - jetty.deploy.defaultsDescriptor - - /etc/webdefault-ee8.xml - + + + + + ee8 + + + + + + + + + jetty.deploy.defaultsDescriptorPath + jetty.deploy.defaultsDescriptor + + /etc/webdefault-ee8.xml + + + + true + + + + + + + + .*/jetty-servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-.*\.jar$ - - true - - - - - - - - .*/jetty-servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-.*\.jar$ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/standalone/deferred-deployment/etc/jetty-ee9-deploy-late.xml b/standalone/deferred-deployment/etc/jetty-ee9-deploy-late.xml index 76136b4..2063730 100644 --- a/standalone/deferred-deployment/etc/jetty-ee9-deploy-late.xml +++ b/standalone/deferred-deployment/etc/jetty-ee9-deploy-late.xml @@ -1,59 +1,48 @@ - - - org.eclipse.jetty.deploy.DeploymentManager - - - - contextHandlerClass - - - - - - - - ee9 - - - - - - - - - jetty.deploy.defaultsDescriptorPath - jetty.deploy.defaultsDescriptor - - /etc/webdefault-ee9.xml - + + + + + ee9 + + + + + + + + + jetty.deploy.defaultsDescriptorPath + jetty.deploy.defaultsDescriptor + + /etc/webdefault-ee9.xml + + + + true + + + + + + + + .*/jetty-jakarta-servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-.*\.jar$ - - true - - - - - - - - .*/jetty-jakarta-servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-.*\.jar$ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/standalone/deferred-deployment/start.d/webapp.ini b/standalone/deferred-deployment/start.d/ee10-webapp.ini similarity index 97% rename from standalone/deferred-deployment/start.d/webapp.ini rename to standalone/deferred-deployment/start.d/ee10-webapp.ini index 7596644..6761450 100644 --- a/standalone/deferred-deployment/start.d/webapp.ini +++ b/standalone/deferred-deployment/start.d/ee10-webapp.ini @@ -3,7 +3,7 @@ # Adds support for servlet specification web applications to the server classpath. # Without this, only Jetty-specific handlers may be deployed. # --------------------------------------- ---module=webapp +--module=ee10-webapp ## Add to the server wide default jars and packages protected or hidden from webapps. ## System classes are protected and cannot be overridden by a webapp. diff --git a/standalone/deferred-deployment/webapps-late/webapp-B.xml b/standalone/deferred-deployment/webapps-late/webapp-B.xml index eded461..d255baf 100644 --- a/standalone/deferred-deployment/webapps-late/webapp-B.xml +++ b/standalone/deferred-deployment/webapps-late/webapp-B.xml @@ -1,7 +1,7 @@ - + /webapps-late/webapp-B.war /appB diff --git a/standalone/deferred-deployment/webapps/webapp-A.xml b/standalone/deferred-deployment/webapps/webapp-A.xml index 0831875..68c6c51 100644 --- a/standalone/deferred-deployment/webapps/webapp-A.xml +++ b/standalone/deferred-deployment/webapps/webapp-A.xml @@ -1,7 +1,7 @@ - + /webapps/webapp-A.war /appA