Apache Sling is an OSGi-based framework for RESTful web-applications using an extensible content tree. In a nutshell, Sling maps HTTP request URLs to content resources based on the request’s path, extension and selectors. Using convention over configuration, requests are processed by scripts and servlets, dynamically selected based on the current resource. This fosters meaningful URLs and resource-driven request processing, while the modular nature of Sling allows for specialised server instances that include only what is needed.
In this talk, we will briefly explain how script processing and deployment currently works in Sling. Furthermore, we will present a novel approach to scripting where script resolution is based on OSGi requirements and capabilities. Not only that this new method preserves the current ease of deployment and content to script mapping, but it also introduces the concept of versioned scripts with explicitly declared dependencies, bridging the gap between OSGi bundles and scripts.