Hi Mahedi,
PageManager expects a fully qualified path.
Since you already have ResourceResolver and Request as well as absolute path, add an extra invocation to retrieve the actual absolute path by calling:
@Mahedi_Sabuj wrote:
Let's assume we have a servlet (resource type binding) that retrieves a list of pages. Within the page properties, we've assigned a sling:alias, let's say "gb" to the uk node. While the servlet works as expected when accessed through "/content/.../uk," when attempting to access it via "/gb," the PageManager.getPage function returns null.
final ResourceResolver resourceResolver = request.getResourceResolver();
final PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
final Page page = pageManager.getPage(rootPagePath); // Retuens NULL for sling:alias
final Resource res = resourceResolver.resolve(request, rootPagePath);
Then path the complete path to get your Page from PageManager.
Hope it helps!
Regards,
Peter