I am developing MVC Portlet
and want to open specific page of my portlet through menu link via Controller.
In velocity template I have portlet name of my portlet.
How can i get plid of that portlet?
My code is as below:
#if ($nav_item.getName().equalsIgnoreCase("specific menu link"))
#set ($myURL = $portletURLFactory.create($request,"portletname_WAR_portletnameportlet",$getterUtil.getLong($plid),"RENDER_PHASE"))
$myURL .setParameter("view","methodName") //Controller paramter
<a href="$myURL" > $nav_item.getName()</a>
#end
Its appending my paramters to current url and staying on current page.
I have added my portlet on another page and tried using hard coded plid, it works fine but for different servers it will create problems.
So, How can i get my portlets plid at runtime in vm file to use while creating URL?