在当前Portlet的JSP中定义另一个Portlet的控制器的resourceUrl [英] Defining resourceUrl of another portlet's controller in current portlet's JSP

查看:71
本文介绍了在当前Portlet的JSP中定义另一个Portlet的控制器的resourceUrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个portlet,其中定义了一些控制器.我们正在使用Spring MVC.在View即JSP中,我们定义了一些resourceUrl,例如

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>

这是指我定义为

@ResourceMapping("getList")
    @ResponseBody
public ModelAndView getList(ResourceRequest request,ResourceResponse response) throws IOException {

.........
}

现在,我想定义另一个resourceUrl,以引用另一个portlet中定义的控制器.我该如何实现?

Now I want to define another resourceUrl referring to a controller which is defined in another portlet. How can I achieve this?

推荐答案

请尝试使用liferay-portlet-ext.tld代替liferay-portlet.tld.

这里的标签数量几乎相同,但是您可以添加一些额外的参数.

Here is almost the same number of tags, but you can add some extra-parameter.

liferay-portlet:resourceURL与portlet:resourceURL类似,除了它具有 其他属性plid,portletName,anchor和crypto.

liferay-portlet:resourceURL is similar to portlet:resourceURL except it has the additional attributes plid, portletName, anchor, and encrypt.

因此,您可以使用以下内容:

So you may use something like the following:

<%@taglib prefix="liferay-portlet" uri="http://liferay.com/tld/portlet" %>

<liferay-portlet:resourceURL id="getList" var="ListResourceUrl" 
                             portletName="portletname_WAR_portletname" />

其中portletname_WAR_portletname是Portlet的实际名称,这是Liferay特有的.

Where portletname_WAR_portletname is actual name of portlet, which is quite Liferay-specific.

这篇关于在当前Portlet的JSP中定义另一个Portlet的控制器的resourceUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆