@siva_sogalapalli
In HTL Text is not printing anything
If I remove postconstruct and SlingHttpServletRequest.class from adaptable then only it is working
did you try to print the log in the model and see whether you're getting page details in the log or not? so that you know whether it's an issue with sling model or issue at HTL level.
I've both postconstruct and SlingHttpServletRequest.class adaptable in my test model and works for me:
@Model(adaptables = {SlingHttpServletRequest.class, Resource.class })@Inject
private Page currentPage;
private String pagePath;
private String pageName;
private String pageTitle;
@PostConstruct
protected void init() {
log.debug("** Start of sling Model **");
pagePath = currentPage.getPath();
pageName =currentPage.getName();
pageTitle = currentPage.getPageTitle();
}
And in sightly:
<sly data-sly-use.model="com.test.TestModel">
${model.pagePath}<br>
${model.pageTitle}<br>
${model.pageName}
</sly>