Expand my Community achievements bar.

Dynamic Drop down Issue

Avatar

Level 5

Hi,

I am having datasource.jsp file same as in this article. https://helpx.adobe.com/experience-manager/using/creating-granite-datasource.html

As per my requirement I need to do customization on top of that. To do so, I need variable such as currentNode or currentPage. I am getting below behavior while using below jsp.

out.println(resource.getPath()); gives result

/mnt/override/apps/vwpoc/components/content/tabcontent/cq:dialog/content/items/tab1/items/column/items/tabbedcontent/field/items/column/items/taskPriority 

But currentPage.getPath() gives error :

Internal Server Error Cannot serve request to /mnt/override/apps/myprj/components/content/tabcontent/_cq_dialog.html/content/myprj/en/homepage/jcr:content/root/responsivegrid/tabs/tabbedpar-0/tabbedcomponent/tabpar-0 in /apps/myprj/components/content/tabcontent/datasource/datasource.jsp  Exception: java.lang.NullPointerException at org.apache.jsp.apps.myprj.components.content.tabcontent.datasource.datasource_jsp._jspService(datasource_jsp.java:142) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 

Also why it is picking up path from /mnt. I am using AEM 6.4.

1 Reply