Resolving a URL to a JCR Node object.

Question

How do I resolve a URL to a JCR Node object?

Answer

To accomplish this you need to
1) Resolve the URL to a sling resource by calling the resolve method of resourceResolver object.
2) Adopt the resource object to a jcr node by calling its' adoptTo method.

The following code would accomplish this.

Resource res = resourceResolver.resolve(uri); 
Node myNode = res.adaptTo(Node.class);  

 Adobe

Krijg sneller en gemakkelijker hulp

Nieuwe gebruiker?

Adobe MAX 2024

Adobe MAX
De creativiteitsconferentie

14–16 oktober Miami Beach en online

Adobe MAX

De creativiteitsconferentie

14–16 oktober Miami Beach en online

Adobe MAX 2024

Adobe MAX
De creativiteitsconferentie

14–16 oktober Miami Beach en online

Adobe MAX

De creativiteitsconferentie

14–16 oktober Miami Beach en online