Hi, may I know,
what is the difference between @ChildResourceFromRequest and @ChildResource with examples
Thank you
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @rahul234dabas ,
let me give you a basic understanding of your doubt.
When we try to inject a resource as @ChildResource, it loses the context of SlingHttpServletRequest. Hence we use @ChildResourceFromRequest instead @ChildResource. The @ChildResourceFromRequest is found in the ACS AEM Commons package. In @ChildResourceFromRequest, it uses a mock request object pointed to the resource path as the adaptable, Which allows the sling model to reference the request. But it fails to inject via the standard @ChildResource injector.
Thanks
Hi please refer to [1] and [2] for the detailed description.
[1]
[2]
Hi @rahul234dabas ,
let me give you a basic understanding of your doubt.
When we try to inject a resource as @ChildResource, it loses the context of SlingHttpServletRequest. Hence we use @ChildResourceFromRequest instead @ChildResource. The @ChildResourceFromRequest is found in the ACS AEM Commons package. In @ChildResourceFromRequest, it uses a mock request object pointed to the resource path as the adaptable, Which allows the sling model to reference the request. But it fails to inject via the standard @ChildResource injector.
Thanks
thank you for reply ,
it helped
Views
Likes
Replies