简体   繁体   English

Liferay-从ASSET PUBLISHER速度模板访问GET或POST参数

[英]Liferay - Access GET or POST parameters from ASSET PUBLISHER velocity template

Is there any way how to access GET or POST parameters from ASSET PUBLISHER velocity template? 有什么方法可以从ASSET PUBLISHER速度模板访问GET或POST参数?

For example, if I have one asset publisher on site /announcements, i need to access GET parameters for example: /announcements?display=maximized. 例如,如果我在站点/ announcements上有一个资产发布者,则需要访问GET参数,例如:/ announcements?display = maximized。

Is there any solution how to access 'display' parameter from velocity template in asset publisher? 有什么解决方案如何从资产发布者的速度模板访问“显示”参数?

Thanks a lot. 非常感谢。

All right, I have found the right solution. 好吧,我找到了正确的解决方案。 In VM template we need to use this command: 在VM模板中,我们需要使用以下命令:

$portalUtil.getOriginalServletRequest($request).getParameter('parameter-name')

In my liferay theme I am getting request parameters this way: 在我的liferay主题中,我通过这种方式获取请求参数:

$request.getParameter("display")

So you may try the same in your template file. 因此,您可以在模板文件中尝试相同的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM