In this blog, I will explain how Sling maps URLs to a script or and servlet.
Scripts and servlets are itself resources in Sling and thus have a resource path: this is either the location in the JCR repository, the resource type in a servlet component configuration or the “virtual” bundle resource path (if a script is provided inside a bundle without being installed into the JCR repository).
Understanding Sling Resolution Process
Sling is resource oriented
Resources are maintained as Virtual tree
Resource is generally mapped to JCR node
URL ->Resource = JCR Structure
Basic Steps of Processing URL
Each Content item in JCR repository is exposed as an HTTP resource.
Decompose the URL
Search for respective Node
Resolve the Resource
Resolve Script/Servlet
Create Rendering Chain
Invoke Rendering Chain
Decomposing The URL
Lets take a sample url: http://learnaem.com/aem/slingresolution.printable.a4.html/a/b?x=true and try to decompose it. This URL can be decomposed as below:
http://learnaem.com – Protocol followed by Host name
AEM – Understanding the Sling Resolution Process!
In this blog, I will explain how Sling maps URLs to a script or and servlet.
Scripts and servlets are itself resources in Sling and thus have a resource path: this is either the location in the JCR repository, the resource type in a servlet component configuration or the “virtual” bundle resource path (if a script is provided inside a bundle without being installed into the JCR repository).
Understanding Sling Resolution Process
Basic Steps of Processing URL
Decomposing The URL
Lets take a sample url: http://learnaem.com/aem/slingresolution.printable.a4.html/a/b?x=true and try to decompose it.
This URL can be decomposed as below:
Resolving Requests to Resources
Locating and Rendering Scripts
Locate:
Identify the resource from the request and locate its resource type, and extract the values
Render Default, if no matching Script:
If no matching script is found, default script is rendered
Multiple Match – More selector matches the better
The script name with best match is selected
e.g. http://learnaem.com/aem/slingresolution.print.a4.html
Recent Posts
Tags
Meta
Categories