AEM SPA Short link implementation
Hi, AEM SPA application doesn't load when we change the URL through redirect or link shorting. Example, changing link from localhost:4502/content/project/us/en/pagename.html to localhost:4502/us/en/pagename.html. Page doesn't throw error but it's just blank page.
I saw some other questions on this forum explaining to change HierarchyPage model method getExportedPath().
Based on Google Search I came across HierarchyPage class.
I have changed the getExportedPath().
public String getExportedPath() {
System.out.println(currentPage.getPath());
String pagePath = currentPage.getPath();
if(pagePath.contains("/content/project")){
String trimmedPagePath = pagePath.replace("/content/project","");
return trimmedPagePath;
}
else{
return currentPage.getPath();
}
}
but still redirect or page sortlink doesn't work. Is this the correct implementation? or can someone share their custom page model implementation for the spa redirect/linkShorting.