osgi / osgi

OSGi Specification Project Build Repository. Specification, API, implementation, and TCK source code.
https://docs.osgi.org/
Apache License 2.0
98 stars 40 forks source link

[Servlet Whiteboard] Prepare Servlet Whiteboard API for use of Servlet 6 #597

Open maho7791 opened 1 year ago

maho7791 commented 1 year ago

The imports of the org.osgi.service.servlet API are restricted to: jakarta.servlet;version="[5.0,6)", jakarta.servlet.http;version="[5.0,6)"

We should prepare the API for Servlet 6

grgrzybek commented 1 year ago

Changes between 5 and 6 (interfaces):

Changes between 5 and 6 (documentation):

Changes between 5 and 6 (implementation):

Changes between 5 and 6 (other):

timothyjward commented 1 year ago

Please check for any removed API used in the TCK as we would need to reimplement or remove those tests.

cziegeler commented 1 year ago

I think it will create a lot of problems to our users if this is a major version update of the API without any good reason. Code written for Servlet API 5 and Servlet Whiteboard 2 should work without any change in a Servlet Whiteboard running with Servlet API 6 (of course under the assumption that no removed API is used). So to support Jakarta Servlet API 6.x, we mostly need wording updates to the spec and an increased import range for the servlet API to include 5 and 6. If the whiteboard will be a major version change then this will make it impossible to provide an implementation that supports whiteboard 2 and whiteboard 3 - and that will create too much of a burden for our users and the whole ecosystem. Even if the new whiteboard is using features that only exists on Servlet API 6 (though I don't know what that really should be), than still a minor version update should be enough. Keep in mind that the http whiteboard support servlet 3 and 4 without any problems. In reality the implementations even supported servlet 2.x

grgrzybek commented 1 year ago

+1 for [5, ∞) (or a bit less radical). This is another compatibility problem between OSGi versioning packages and Maven/Jakarta versioning releases/jars/specs...

cziegeler commented 9 months ago

For the record, we have now an implementation in Apache Felix that is based on Servlet 6 (Jetty 12) and supports all existing OSGi specifications (http service, http whiteboard, and servlet whiteboard). It shows that there is no real need to a servlet whiteboard update (other than wording), especially no need for a major version update. https://github.com/apache/felix-dev/tree/master/http/jetty12

grgrzybek commented 9 months ago

Jetty 12 had some issues with welcome files handling, but I hope it didn't affect Felix-HTTP.

I didn't check yet, but does it mean that Felix-HTTP still uses/implements org.osgi.service.http service with HttpService interface accepting javax.servlet.Servlet parameters?

cziegeler commented 9 months ago

welcome files should not affect Apache Felix http and yes, it still supports the http service specification with the javax.servlet namespace. It provides a painless upgrade path (at least thats the theory).

grgrzybek commented 9 months ago

I can't see you on Slack, so let me ask here - is https://github.com/apache/felix-dev/tree/master/http/jetty12 declared as module? or is it (for now) a PoC not part of multi-module projects?

cziegeler commented 9 months ago

Best place to ask is the Apache Felix dev mailing list - what type of module do you mean, Java, Maven..?

grgrzybek commented 9 months ago

I was just checking https://github.com/apache/felix-dev/blob/master/http/pom.xml#L41-L53. I also seejetty12 Maven profile, but it doesn't include jetty12 module.

But I could check the source and I get it now - org.apache.felix.http.jakartawrappers.ServletWrapper is what I was looking for ;). Thanks.

stbischof commented 9 months ago

Do we really need no update on the the versions import versions?

jakarta.servlet;version="[5.0,6)", jakarta.servlet.http;version="[5.0,6)"

like:

jakarta.servlet;version="[5.0,7)", jakarta.servlet.http;version="[5.0,7)"

cziegeler commented 9 months ago

Depends on who "we" is - if you want to have your bundle running with Servlet 5 and 6 this is one way of doing it