List of components
How to fetch list of components configured on current page?
I tried
ComponentManager componentManager = resourceResolver.adaptTo(ComponentManager.class);
Collection<com.day.cq.wcm.api.components.Component> components = componentManager.getComponents();
for (com.day.cq.wcm.api.components.Component component : components) {
if (component.getPath().startsWith("/apps")) {
}
}
but it 's not listing the exact components which has been configured on the page.
Any other way can someone answer may be with predicate query or something easier and efficient way?