{"id":14988219,"url":"https://github.com/apache/sling-org-apache-sling-api","last_synced_at":"2025-04-05T12:05:17.187Z","repository":{"id":26419418,"uuid":"107432523","full_name":"apache/sling-org-apache-sling-api","owner":"apache","description":"Apache Sling API","archived":false,"fork":false,"pushed_at":"2025-02-26T13:13:37.000Z","size":1458,"stargazers_count":14,"open_issues_count":0,"forks_count":22,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-29T11:07:19.469Z","etag":null,"topics":["java","sling"],"latest_commit_sha":null,"homepage":"https://sling.apache.org/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-18T16:13:19.000Z","updated_at":"2025-02-26T13:13:41.000Z","dependencies_parsed_at":"2023-10-13T08:06:00.084Z","dependency_job_id":"6196e244-f80b-4116-ae8e-f32c4e26f531","html_url":"https://github.com/apache/sling-org-apache-sling-api","commit_stats":{"total_commits":677,"total_committers":39,"mean_commits":"17.358974358974358","dds":0.51698670605613,"last_synced_commit":"802e8cb1bf40dfc84559df410de435dd94cec1dc"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fsling-org-apache-sling-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/sling-org-apache-sling-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332602,"owners_count":20921853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","sling"],"created_at":"2024-09-24T14:16:18.606Z","updated_at":"2025-04-05T12:05:17.166Z","avatar_url":"https://github.com/apache.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Apache Sling](https://sling.apache.org/res/logos/sling.png)](https://sling.apache.org)\n\n\u0026#32;[![Build Status](https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-api/job/master/badge/icon)](https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-api/job/master/)\u0026#32;[![Test Status](https://img.shields.io/jenkins/tests.svg?jobUrl=https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-api/job/master/)](https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-api/job/master/test/?width=800\u0026height=600)\u0026#32;[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=apache_sling-org-apache-sling-api\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-api)\u0026#32;[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=apache_sling-org-apache-sling-api\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-api)\u0026#32;[![JavaDoc](https://www.javadoc.io/badge/org.apache.sling/org.apache.sling.api.svg)](https://www.javadoc.io/doc/org.apache.sling/org.apache.sling.api)\u0026#32;[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.sling/org.apache.sling.api/badge.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.sling%22%20a%3A%22org.apache.sling.api%22) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\n# Apache Sling API\n\nThis module is part of the [Apache Sling](https://sling.apache.org) project.\n\nThe Sling API defines an extension to the Jakarta Serlvet API 6.0 to\nprovide access to content and unified access to request\nparameters hiding the differences between the different methods\nof transferring parameters from client to server. Note that the\nSling API bundle does not include the Servlet API but instead\nrequires the API to be provided by the Servlet container in\nwhich the Sling framework is running or by another bundle.\n\n## Updating to Sling API 3\n\nSling 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.\n\n### Dependency to Jakarta Servlet API\n\nAs 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.\n\nAdd a dependency like `jakarta.servlet:jakarta.servlet-api:6.0.0` to your project.\n\nAt runtime, you need a container implementing the Jakarta Servlet API. For example, you can use Apache Felix Http Jetty 12.\n\n### Minimum Java Runtime\n\nAs the Jakarta Servlet API requires Java 17, the Sling API now requires Java 17 as a minimum Java version at runtime as well.\n\n### Source Code Incompatibilties\n\nFor 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.\n\nIf such compilation error occurs nevertheless, a quick (but wrong) fix is to cast `null` to the Jakarta Servlet API type. However, the correct fix is to not call this method with a `null` argument at all and change the code accordingly.\n\n## Migrating from Servlet API 3 to Jakarta Servlet API 6\n\nWith the release of Sling API Version 3, the Jakarta Servlet API is used as the base. Previous releases are based on the Javax Servlet API 3. While the API based on Servlet 3 is still available and functional, it is mainly there for compatiblity. All new code should leverage Jakarta Servelt API and it is advised to migrate existing code.\n\nIn most cases, the migration is as simply as a series of search and replace operations. For Sling API based on Servlet 3 there is an alternative with the same functionality based on Jakarta Servlet API. However, for API that has been deprecated already, there is no alternative. Therefore, all usage of deprecated Sling API needs to be replaced first.\n\nThe following table lists the replacements:\n\n| Feature | Servlet API 3 | Jakarta Servlet API 6 |\n| ------- | -------------- | --------------------- |\n| Package Prefix | `javax.servlet` | `jakarta.servlet` |\n| Request Interface | SlingHttpServletRequest | SlingJakartaHttpServletRequest |\n| Response Interface | SlingHttpServletResponse | SlingJakartaHttpServletResponse |\n| Event Interface | SlingRequestEvent | SlingJakartaRequestEvent |\n| Event Listener | SlingRequestListener | SlingJakartaRequestListener |\n| Builders | SlingHttpServletRequestBuilder.build() | SlingHttpServletRequestBuilder.buildJakartaRequest() |\n| Builders | SlingHttpServletResponseBuilder.build() | SlingHttpServletResponseBuilder.buildJakartaResponse() |\n| Builders | SlingHttpServletResponseResult | SlingJakartaHttpServletResponseResult |\n| Media Range | MediaRangeList | JakartaMediaRangeList |\n| Scripting | SlingBindings | SlingJakartaBindings |\n| Scripting | SlingScript | SlingJakartaScript |\n| Scripting | SlingScriptHelper | SlingJakartaScriptHelper |\n| Error Handling | ErrorHandler | JakartaErrorHandler |\n| Scripting | OptingServlet | JakartaOptinServlet |\n| Scripting | SlingAllMethodsServlet | SlingJakartaAllMethodsServlet |\n| Scripting | SlingSafeMethodsServlet | SlingJakartaSafeMethodsServlet |\n| Wrapper | SlingHttpServletRequestWrapper | SlingJakartaHttpServletRequestWrapper |\n| Wrapper | SlingHttpServletResponseWrapper | SlingJakartaHttpServletResponseWrapper |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fsling-org-apache-sling-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fsling-org-apache-sling-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fsling-org-apache-sling-api/lists"}