Solved
Trying to get the different page title in my sling model
Hello Team,
I have a page which has these title
jcr:title has the value: ABC Page
navTitle has the value: navTitle123
pageTitle has the value: myPageTitle
In my custom sling model logic, I have written these statements to get the page title.
private Page currentPage; // Initialized properly with annotation.
String navTitle = StringUtils.defaultIfEmpty(currentPage.getNavigationTitle(), currentPage.getTitle());
// Displays Navigation title: navTitle123
String newTitle = currentPage.getTitle();
// This displays "ABC Page" instead of "myPageTitle"
When I googled, i came to know that currentPage.getTitle() internally checks for page Title. If its not present, then only it returns jcr:title

So, What I am missing here?