Resource object needs to be adapted to Page class or a way to extract/refer page related to resource. I have tried following way; however it does not seems to work
final Resource resource = resourceResolver.getResource(pagePath);
final Page cPage = resource.adaptTo(Page.class);
It returns null
o cPage
Try with PageManager