I have two portlets with some set of controllers defined. We are using Spring MVC. In the View i.e JSP we defining some resourceUrls like
<portlet:resourceURL var="ListResourceUrl" id="getList" ></portlet:resourceURL>
this refers to the controller which I have defined as
@ResourceMapping("getList")
@ResponseBody
public ModelAndView getList(ResourceRequest request,ResourceResponse response) throws IOException {
.........
}
Now I want to define another resourceUrl referring to a controller which is defined in another portlet. How can I achieve this?
Please try to use
liferay-portlet-ext.tld
instead ofliferay-portlet.tld
.Here is almost the same number of tags, but you can add some extra-parameter.
So you may use something like the following:
Where
portletname_WAR_portletname
is actual name of portlet, which is quite Liferay-specific.If you want to create a PortletURL programmatically in a controller use PortletURLFactoryUtil. The following snippet should give you an idea: