Fetch site page path in AEM component
I'm trying to fetch the site page path that my AEM component resides in. However when I try it with this following method, I get the top-level path returned (i.e. /content/my-site/us/en) instead of the actual page path. Any suggestions on how to adjust this method? Thanks.
PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
Page currentPage = pageManager.getContainingPage(request.getResource());
String currentPagePath = currentPage.getPath();
