Adobe Experience Manager (AEM) AD0-E121 Practice Test

Access More Questions
What is the ResourceResolver API in Sling, and how do you obtain a Resource for a given path?
Correct Answer:
ResourceResolver provides access to the JCR repository; obtain via ResourceResolverFactory getResourceResolver, then call getResource("/content/...")
Explanation:
ResourceResolver lets you access resources stored in the Sling/AEM repository (the JCR hierarchy) in a consistent, service- or request-scoped way. To get a Resource for a specific path, you first obtain a ResourceResolver from the ResourceResolverFactory, typically using a service user (via a subservice) or from a request. Once you have the resolver, you can fetch the resource with the path you want. Example pattern: - Build the login params, usually using a service user: map.put(ResourceResolverFactory.SUBSERVICE, "myService"); - Get the resolver: ResourceResolver resolver = resourceResolverFactory.getResourceResolver(params); - Retrieve the resource: Resource resource = resolver.getResource("/content/your/path"); - Always close the resolver when done: resolver.close(); This approach is about accessing repository resources through the resolver, not about direct database access, UI rendering, or authentication handling.

Access more questions from this quiz

Continue to Adobe Experience Manager (AEM) AD0-E121 Practice Test for more practice questions and the full quiz experience.

Access More Questions