如何获取在浏览器中显示的 Liferay 当前 url?

How to get Liferay current url that is being displayed in browser?

我在页面 "Portlet A" 和 "Portlet B" 上有两个 portlet。 该页面有urlhttp://localhost:8080/web/guest/page?p_p_id="Portlet A"... 然后我在 "Portlet B" 中提交一个表单并尝试从 PortalUtil 中获取当前的 url like

PortalUtil.getCurrentURL(myRequest);//p_p_id="Portlet B"...
themeDisplay.getURLCurrent(myRequest);p_p_id="Portlet B"...

但是在提交之前在浏览器中我看到 url 和 p_p_id="Portlet A"...

有没有办法获取正在向用户显示的 url?

我要找的link叫做Referer,指向请求来自的页面。 感谢Tobias Liefke

在 Liferay 中,您可以使用 portlerRequest.getHttpRequest().getHeader("Referer")

找到它