Allows for Sling Models classes and interfaces to be injected with common AEM-related objects, namely those made available using <cq:defineObjects/>:
- resource
- resourceResolver
- componentContext
- pageManager
- currentPage
- resourcePage
- designer
- currentDesign
- resourceDesign
- currentStyle
- session
- xssApi
Most injections are available when adapting either a Resource or SlingHttpServletRequest object, with these exceptions, which only work when adapting a SlingHttpServletRequest object:
- currentPage
- componentContext
- xssApi
- currentDesign
public class TestModel {
@Inject
private Page resourcePage;
public Page getResourcePage() {
return resourcePage;
}
}
No comments:
Post a Comment
If you have any doubts or questions, please let us know.