joerghoh commented on code in PR #55: URL: https://github.com/apache/sling-org-apache-sling-api/pull/55#discussion_r1926908241
########## README.md: ########## @@ -6,10 +6,61 @@ This module is part of the [Apache Sling](https://sling.apache.org) project. -The Sling API defines an extension to the Servlet API 3.0 to +The Sling API defines an extension to the Jakarta Serlvet API 6.0 to provide access to content and unified access to request parameters hiding the differences between the different methods of transferring parameters from client to server. Note that the Sling API bundle does not include the Servlet API but instead requires the API to be provided by the Servlet container in which the Sling framework is running or by another bundle. + +## Updating to Sling API 3 + +Sling API 3 adds support for Jakarta Servlet API. Updating to the latest API version should just be a drop-in replacement. However, there are some points to considers. + +### Dependency to Jakarta Servlet API + +As the API references the Jakarta Servlet API in several signatures, it is very likely that you need to add the Jakarta Servlet API to the dependency list of your project. And that is in addition to the already existing dependency to the Javax Servlet API. + +Add a dependency like `jakarta.servlet:jakarta.servlet-api:6.0.0` to your project. + +At runtime, you need a container implementing the Jakarta Servlet API. For example, you can use Apache Felix Http Jetty 12. + +### Minimum Java Runtime + +As the Jakarta Servlet API requires Java 17, the Sling API now requires Java 17 as a minimum Java version at runtime as well. + +### Source Code Incompatibilties + +For some methods where a Javax Servlet Type is used in the signature, an alternative method has been added with the same name but different signature. This can lead to compilation errors due to disambigutie *if* the actual argument is `null`. However, all of these methods to not allow `null` as an argument, therefore this should not create a problem in reality. Review Comment: ```suggestion For some methods where a Javax Servlet Type is used in the signature, an alternative method has been added with the same name but different signature. This can lead to compilation errors due to disambigutie *if* the actual argument is `null`. However, all of these methods do not allow `null` as an argument, therefore this should not create a problem in reality. ``` -- 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]
