gpt4 book ai didi

java - 如何从 LIferay/IceFaces/JSF portlet 支持 bean 中获取 url 请求参数

转载 作者:行者123 更新时间:2023-11-30 11:51:23 25 4
gpt4 key购买 nike

portlet 是否可以读取其周围页面的请求参数?

例如Portlet 所在页面的 URL 是 http://example.com/mygroup/mypage?foo=bar是否可以从该页面上的 portlet 读取“foo”参数?

Portlet 容器是 Liferay 6.0.5。

附言

我已经试过了:

com.liferay.portal.util.PortalUtil.getOriginalServletRequest(com.liferay.portal.util.PortalUtil.getHttpServletRequest((javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest())).getParameter("foo")

但我总是得到 null 的 productId

谢谢!

最佳答案

你试过吗

ExternalContext.getRequestParameterMap()

关于java - 如何从 LIferay/IceFaces/JSF portlet 支持 bean 中获取 url 请求参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7490966/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com