0
votes

I want to get a node using node identifier. Right nowi'm using session to get the node i.e

Node node = session.getNodeByIdentifier(node.getTierIdentifier());

but i want to get it using Page or resource instead of session is there any method or way to get the node without session ?

1

1 Answers

0
votes

You need to have a JCR Session to do it. If you have a Page or a Resource, you may get the related PageManager or ResourceResolver and adapt them to the Session:

Session session = page.getPageManager().adaptTo(Session.class);

or

Session session = resource.getResourceResolver().adaptTo(Session.class);