I am new to Apache Sling, CQ5, etc.
In our codebase, we have a code snippet similar to this:
void perform(SlingHttpServletRequest request, SlingHttpServletResponse response) {
ResourceResolver resourceResolver = request.getResourceResolver();
Session session = resourceResolver.adaptTo(Session.class);
PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
}
What's adapTo
doing here?
Also is there a good documentation/user manual available I can read to get started using Sling, CQ5, etc.?
ResourceResolver
looks more like a Service Locator. I mean, is it transforming itself to different types of classes, or is it finding the appropriate class and return it? – Candycecandystriped