jbonofre opened a new pull request, #3009:
URL: https://github.com/apache/karaf/pull/3009

   This PR adds `karaf-web`, a web container simpler than Pax Web, based on an 
embedded Apache Tomcat 11 (Servlet 6.1, Java 17).
   
   ### The `services/web` module
   
   The `org.apache.karaf.services.web` bundle embeds Tomcat privately (Tomcat 
logs to the Karaf log via the `org.apache.juli.logging` package of Pax Logging) 
and supports:
   
   * **OSGi Servlet Whiteboard** (`org.osgi.service.servlet`, the Jakarta 
version of the HTTP Whiteboard): servlets, filters (patterns, servlet names, 
regex, dispatchers), listeners, resources and servlet context helpers (custom 
contexts, `handleSecurity`, resources, MIME types). Shadowing by name/pattern 
and ranking, with the services not deployed reported with the reason. Services 
registered together are deployed together (100 ms debounce); the unregistration 
of a service waits for its undeployment.
   * **Web Application Bundles** (`Web-ContextPath`): resources read from the 
bundle entries, classes loaded by the bundle class loader, `web.xml`, web 
fragments, `@WebServlet`/`@WebFilter`/`@WebListener`, 
`ServletContainerInitializer`, default servlet and welcome files, 
authentication with the Karaf JAAS realm, and the `ServletContext` service with 
the `osgi.web.*` properties.
   * **Configuration** with the `org.apache.karaf.services.web` PID: host, 
HTTP/HTTPS ports, keystore, max threads, session timeout, JAAS realm, undeploy 
timeout. A configuration change restarts Tomcat.
   * **Commands**: `web:context-list`, `web:servlet-list` and `web:filter-list`.
   
   Not supported: JSP, WAR deployment (`war:`/`webbundle:`), whiteboard error 
pages and preprocessors, `osgi.http.whiteboard.target`, `HttpServiceRuntime`, 
and the `javax` OSGi HTTP Service.
   
   ### Distribution
   
   * New `karaf-web` feature in the standard features (the Servlet API and the 
`org.apache.karaf.services.web` bundle).
   * `karaf-web` is an installed feature of the karaf-light distribution 
(`feature:install karaf-web`), not a boot feature.
   * The manual gets a new "Karaf Web Container (Apache Tomcat)" chapter, and 
the karaf-light README mentions the feature.
   
   `karaf-web` is an alternative to the Pax Web features: they use the same 
default port and the same `web:*` command names, so they should not be 
installed together.
   
   ### Tests
   
   * Unit tests for the configuration, the context paths, the bundle resource 
set and the resource servlet (on a real Tomcat).
   * New `KarafWebTest` itest (context list, whiteboard servlet deployment and 
synchronous undeployment) and `StandardFeaturesTest#installKarafWebFeature`.
   * Tested manually in karaf-light: whiteboard 
servlets/filters/resources/helpers, WABs with `web.xml`, annotations and BASIC 
authentication, HTTPS with a PKCS12 keystore, configuration changes, Karaf 
restart and feature uninstall.
   
   `MavenTest` fails on `main` already (no version for 
`jakarta.servlet/jakarta.servlet-api`); with the Servlet API dependency added 
to the itests it gets further, but it then fails to load `KarafTestSupport` in 
its probe, a separate issue.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to