Apache Sling Validation Framework Examples
January 11, 2022 ยท View on GitHub
Apache Sling Validation Framework Examples
This module is part of the Apache Sling project.
How To Run the Examples
-
Start a Sling Starter (or some other distribution)
-
Install the
org.apache.sling.validation.apiandorg.apache.sling.validation.corebundles -
Build and install the
org.apache.sling.validation.examplesbundlemvn clean package sling:install
Invalid POST request
curl -u admin:admin -Fsling:resourceType=/apps/validationdemo/components/user -Fusername=johnsmith -FfirstName=John204 -FlastName=Smith http://127.0.0.1:8080/content/validationdemo/users/johnsmith.modify.html
Check that the resource has not been modified at http://127.0.0.1:8080/content/validationdemo/users/johnsmith.html.
Valid POST request
curl -u admin:admin -Fsling:resourceType=/apps/validationdemo/components/user -Fusername=johnsmith -FfirstName=Johnny -FlastName=Bravo http://127.0.0.1:8080/content/validationdemo/users/johnsmith.modify.html
Check that the resource has been modified at http://127.0.0.1:8080/content/validationdemo/users/johnsmith.html.
