Sling Models and adaptables- SlingHttpServletRequest and Resource
Hi,
I had couple questions, i wanted to get the current page path as well as the properties under page/jcr:content/image/fileReference.
Option1- If i use a resource as adaptable, i can get file reference but unable to get current page path, the resource.getPath points to the jcr:content of the page.
If i use the resource resolver from the resource marked with @self, do i have to close it? Is it wise?
PageManager pageManager= resource.getResourceResolver().adaptTo(PageManager.class);
Page currentPage = pageManager.getContainingPage(resource);
2. If i use SlingHttpServletRequest and Resource, i am not able to get the properties under page/jcr:content/image/fileReference while i could get the currentpage path.
Tried @2434638 but in vain
Is it wise to use both adaptables?
Thanks in advance