You should be able to get the path to the current page by:
String pagePath = currentPage.getPath();
Ya current page path returns me till the page node.... i have a parsys inside the jcr :content..... I have to traverse till the parsys dynamically
/content/test/jcr:content/<parsys>/start/survey suppose survey is one component. If i give currentpage.getPath it will give me /content/test.. But i have to go till parsys in a single go without traversing the node. Is it possible...? according to the person creating template <parsys> node name may vary
I don't know if understand your requirement correctly, but if you want a path to the survey component added to this dynamic parsys inside your page you can use inside survey.jsp file in the survey component something like:
String pathToSurveyComponent = component.getPath();
In that case you should have always in the String variable path to current component added to this parsys.
component.getPath is giving me component path in the crx starting with /apps/........
Sorry Vena, try to use instead: