Hi Team
I want to get dispatcher url so that I can perfrom url splitting and get titles.
Currently when I try with below I am getting author /content urls even on publisher and dispatcher getting /content urls.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Prashardan, You need to configure Resource Mapping (/etc/map) for your website first. Then use the following Java code for Dispatcher URL:
String contentPath = getCurrentPage().getPath();
String mappedURL = getResourceResolver().map(contentPath); // Dispatcher URL
In Page Properties, 3 options are available. Please choose the method based on your requirement.
Hi @Prashardan, You need to configure Resource Mapping (/etc/map) for your website first. Then use the following Java code for Dispatcher URL:
String contentPath = getCurrentPage().getPath();
String mappedURL = getResourceResolver().map(contentPath); // Dispatcher URL
In Page Properties, 3 options are available. Please choose the method based on your requirement.
To get page title you can directly work with currentPage.getPageTitle() or currebtPage.getTitle() you don’t need to have dispatcher url. It will work for both author and publisher url.
and if you really need the dispatcher url then you can work with resourceresolver.map() to get the dispatcher url
Views
Likes
Replies
Views
Likes
Replies