Can any one explain me what will happen internally into Aem content. How it gets resolved and represented back to presentation layer.? Am more curious about the Sling internal mechanism on top of content delivery resolvation.
1 Answers
The answer to this question could be very detailed, because there is a lot going on when "content" is resolved and presented (by the presentation layer).
You can find a more detailed explanation in the official AEM documentation.
The gist of it is, that Sling will look at the URL that is called and will try to find out to which "content" (or more precisely "resource") this URL points to in the repository. Usually, there is a one to one relationship between a URL and a resource.
But here it gets a bit more complicated. Most of the time this "resource" is a page. And a page is composed of a lot of smaller parts. Those parts are called "components". A simple example would be a page with a blog post. You might have a component for the header of the page, the footer, the navigation and all of the other content in between, like the text and images of the blog post. All those different parts are components.
Sling will find all of the components that are on the page and will render all of them separately to build the page. Most components will have a JSP or HTL (Sightly) template which Sling uses to render the component. Those templates on the other hand might have their own internal logic which might use OSGi services or servlets to build the content that is displayed.
This was just a simple example to show you how it basically works. But it is far more complicated under the hood. There is a myriad of different things going on behind the scenes that you, as a developer, can use to influence this process. One example for this would be Sling Filter.