【发布时间】:2017-05-10 19:11:57
【问题描述】:
我在登录后挂钩中有一个 HttpServletRequest 对象。如何获取浏览器的 URL。
当我使用 PortalUtil.getCurrentCompleteURL(HttpServletRequest) 时,我总是得到http://localhost:8080/c。我需要http://localhost:8080/web/abc之类的东西。
我没有 ThemeDisplay 对象。
【问题讨论】:
-
你试过 PortalUtil.getCurrentURL(myRequest);
-
@Issamovitch 给了我 /c
-
我认为您的示例应该可以工作: HttpServletRequest servletRequest = PortalUtil.getHttpServletRequest(request); String currentCompleteUrl = PortalUtil.getCurrentCompleteURL(servletRequest);
-
@Issamovitch 我已经有了 HttpServletRequest。所以我不需要 PortalUtil 的那个。 PortalUtil.getCurrentCompleteURL(servletRequest);给我localhost:8080/c
标签: liferay-6.2