如何从Liferay Portlet中的URL获取参数?

编程入门 行业动态 更新时间:2024-10-26 11:16:40
本文介绍了如何从Liferay Portlet中的URL获取参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Liferay 6中使用了像feed.jspf这样的现成Portlet的jsp:

I'm using jsp of out-of-box portlet like feed.jspf in Liferay 6:

String articleId =null; HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(renderRequest)); articleId = httpReq.getParameter("articleId");

无论是在自定义portlet还是.jsp文件中,它都给出一个空值,但是它应该有一个值.

It is giving a null value whether in custom portlet or in .jsp files, but it should have a value.

推荐答案

当然,您始终可以使用标准的HttpServletRequest从中检索参数.您可以通过使用PortalUtil类来获得此请求,如以下示例所示:

Sure, you can always use the standard HttpServletRequest to retrieve your parameters from. You can get this request by using the PortalUtil class, like in the following example:

HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest); String articleId = request.getParameter("articleId");

更多推荐

如何从Liferay Portlet中的URL获取参数?

本文发布于:2023-10-07 17:42:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470067.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   Liferay   Portlet   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!