We are facing issue similar to below thread, but we don't want to use querymanager but rather use the currentNode object
http://stackoverflow.com/questions/18850171/currentnode-object-gives-nullpointerexception
In our code we have something like below:
In the control tabControlPG, we are using currentNode.getProperty(). currentNode is always null. So I tried using request.getResource() and even that throws error that getResource() is not availble for HttpServletRequest.
Any ideas or pointers are really appreciated.
<%if(currentPage.getName().equalsIgnoreCase("Documents-Publications")) {%>
<cq:include path="mainContent/tabcontrol" resourceType="/apps/imf/mobile/components/content/customComponents/tabControl"/>
<%}
else if(currentPage.getName().equalsIgnoreCase("logistics")) {%>
<cq:include path="mainContent/tabcontrol" resourceType="/apps/imf/mobile/components/content/customComponents/tabControlPG"/>
<%}%>
Solved! Go to Solution.
Views
Replies
Total Likes
I think you are getting currentNode and resource as null in the included script may be because you are setting "path" as virtual as it is pointing to a non existent node in CRX. If that node does not exist then these tags won't inject the resource/node in the request context for processing. Whatever node you want to access in the included JSP, you should set the path to that particular node.
Please see the documentation here -
https://docs.adobe.com/docs/en/cq/5-6/howto/taglib.html#%3Ccq:include%3E
https://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html
Views
Replies
Total Likes
Have you tried using <sling:include> tag for this use case ?
<sling:include path="mainContent/tabcontrol" resourceType="imf/mobile/components/content/customComponents/tabControlPG" />
Views
Replies
Total Likes
Yes have tried that too
Views
Replies
Total Likes
I think you are getting currentNode and resource as null in the included script may be because you are setting "path" as virtual as it is pointing to a non existent node in CRX. If that node does not exist then these tags won't inject the resource/node in the request context for processing. Whatever node you want to access in the included JSP, you should set the path to that particular node.
Please see the documentation here -
https://docs.adobe.com/docs/en/cq/5-6/howto/taglib.html#%3Ccq:include%3E
https://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html
Views
Replies
Total Likes
Thanks for your tip. Will try and let you know if it works
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies