Provides the default POST servlet bundle for Apache Sling.
This module is part of the Apache Sling project. You can read more about this module on our documentation site.
The bundle provides the default SlingPostServlet and built-in POST operations for Sling content changes, including:
The implementation is Jakarta Servlet-first and uses Sling Jakarta APIs. Legacy javax.servlet SPI integration remains supported via adapters in impl/wrapper and service proxying in PostOperationProxyProvider.
Custom behavior can be provided via OSGi services such as:
JakartaPostOperationSlingJakartaPostProcessorJakartaNodeNameGeneratorJakartaPostResponseCreatorThe corresponding legacy extension types (PostOperation, SlingPostProcessor, NodeNameGenerator, PostResponseCreator) are still supported through compatibility wrappers.
Java 17 is required.
mvn clean installmvn clean install -DskipTestsmvn testModifyOperationIT): mvn verifymvn test -Dtest=HtmlResponseTestmvn verify -Dit.test=ModifyOperationITjar tf target/org.apache.sling.servlets.post-*.jar | grep -E 'META-INF/MANIFEST.MF|SLING-INF/nodetypes/chunk.cnd'For manual file-upload protocol checks against a running Sling instance on localhost:8080 (admin:admin), use:
sh developer-tests/testFileUploads.sh <testfile>
The script uploads using regular, streamed, and chunked streamed protocols, then downloads and compares content. See developer-tests/README.md and Protocols.md for protocol and script details.
pom.xml Maven build descriptor (packaging: jar) bnd.bnd OSGi bundle instructions and embedded resources Jenkinsfile ASF Jenkins pipeline definition Protocols.md Protocol notes for POST and upload behavior src/ main/java/org/apache/sling/servlets/post/ *.java Public Jakarta-first API/SPI (+ legacy compatibility APIs) exceptions/ Persistence-related exceptions impl/ Internal servlet and operation implementations PostOperationProxyProvider.java Legacy service proxy registration operations/ Built-in POST operations helper/ Internal helpers (upload, property handling, naming, chunking) wrapper/ Jakarta <-> javax bridging adapters main/resources/ SLING-INF/nodetypes/chunk.cnd Chunked upload node type definitions org/apache/sling/servlets/post/ HTML response templates system/sling.js Bundled JS resource test/java/ Unit and integration tests developer-tests/ Manual developer test scripts
bnd-maven-plugin), with API baseline checks via bnd-baseline-maven-plugin.jackrabbit-jcr-commons and sling-jcr-contentparser into internal impl packages.javax.jcr.*) and org.apache.sling.jcr.contentloader imports are configured as dynamic for runtime flexibility.jakarta.servlet-api as the primary servlet API while keeping javax.servlet-api and org.apache.felix.http.wrappers for compatibility adapters.