Hi All,
It is mentioned here that
Note: resource.adaptTo(Node.class)
may return null if the resource is not backed by a JCR node. This is particularly the case for NonExistingResource
resources or resource provided by a non-JCR resource provider.
1] But isn't it something like every resource[probably a node] always has a jcr:content associated with it.
Can you please let me know on this.
Solved! Go to Solution.
Views
Replies
Total Likes
Not in all cases, you can create a so called SyntheticResource
https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/org/apache/sling/api/resource/SyntheticResource.html
I would always go for resource.getValueMap(), this is much easier way to access properties.
Views
Replies
Total Likes
Not in all cases, you can create a so called SyntheticResource
https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/org/apache/sling/api/resource/SyntheticResource.html
I would always go for resource.getValueMap(), this is much easier way to access properties.
Views
Replies
Total Likes
Hi Feike,
Thank you for your reply.
I was not aware that something like this exists. But what exactly would be the purpose of SyntheticResource. If you can provide any example, it would be helpful.
Views
Replies
Total Likes
For example you have a servlet that is registered on a path like "/bin/xyz". In this case request.getResource() isn't pointing you to a 'real/existing' resource.
Views
Replies
Total Likes