简体   繁体   中英

AEM: Convert/Adapt resource to page

Resource object needs to be adapted to Page class or a way to extract/refer page related to resource. I have tried following way; however it does not seems to work

final Resource resource = resourceResolver.getResource(pagePath);
final Page cPage = resource.adaptTo(Page.class);

It returns null o cPage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM