【问题标题】:Liferay is generating a blank URL in the back arrow that is created when a portlet is maximizedLiferay 在最大化 portlet 时创建的后退箭头中生成一个空白 URL
【发布时间】:2020-01-15 18:21:22
【问题描述】:

当一个 portlet 被最大化时(p_p_state=maximized),Liferay 会生成一个后退箭头以允许导航回到“整页”。

但是,生成的标签中的 HREF 是空白的。没有网址。这不会发生在我的本地机器上,但会发生在我的服务器上(本地和服务器是 Liferay 7、GA7)。

我发现这是作为一个标签创建的,其 HREF 设置为 ${portlet_back_url},而该标签又是从 htmlUtil.escapeHREF(portlet_display.getURLBack()) 创建的。

这让我想到了 com.liferay.portal.kernel.theme.PortletDisplay 中的 getURLBack() 方法,它似乎只是一个具有很多属性的 bean。有一个 setURLBack(),它从 150 个文件(主要是 JSP)中调用。所以这个值不能被设置 - 但我找不到应该从哪里设置,我不明白为什么它在本地工作正常。

此外,在控制面板中工作时,内置 portlet(用户、组织、站点等)上的后退箭头表现出相同的行为 - 所以问题是系统性的(不仅仅是我的自定义 portlet)。而且,正如我所提到的,在我的本地机器上使用相同的 Liferay 捆绑包很好 - 所以我很确定环境中有一些不同的地方。

有人遇到过这个吗?关于在哪里看的任何提示?

【问题讨论】:

  • 另外,日志中似乎有很多可能相关的警告消息:Redirect URL [some full URL] is not allowed

标签: liferay liferay-7


【解决方案1】:

部署到服务器后,您需要更新重定向 url/ip 请参考并更新您的 portal.properties 中的以下属性。

重定向

# Set this property to "ip" or "domain" for the redirect security method. If
# set to "domain", the portal will only redirect users to domains listed in
# the property "redirect.url.domain.allowed". If set to "ip", the portal
# will only redirect to domains whose IP address resolve to an IP address
# listed in the property "redirect.url.ip.allowed".
#
# Env: LIFERAY_REDIRECT_PERIOD_URL_PERIOD_SECURITY_PERIOD_MODE
#
#redirect.url.security.mode=domain
redirect.url.security.mode=ip

#
# Input a list of comma delimited domains which the portal is allowed to
# redirect to. Input a blank list to allow any domain. Specifying a domain
# with a leading "*." allows redirects to subdomains.
#
# Env: LIFERAY_REDIRECT_PERIOD_URL_PERIOD_DOMAINS_PERIOD_ALLOWED
#
redirect.url.domains.allowed=

#
# Input a list of comma delimited IPs which the portal is allowed to
# redirect to. Input a blank list to allow any IP. SERVER_IP will be
# replaced with the IP of the host server.
#
# Env: LIFERAY_REDIRECT_PERIOD_URL_PERIOD_IPS_PERIOD_ALLOWED
#
redirect.url.ips.allowed=127.0.0.1,SERVER_IP

【讨论】:

  • 完美运行。我想我从未在文档中看到过(从 Liferay 6.2 升级)。感谢您的快速回复!
猜你喜欢
  • 1970-01-01
  • 2015-07-16
  • 1970-01-01
  • 1970-01-01
  • 2012-04-26
  • 1970-01-01
  • 2015-07-21
  • 2020-05-10
  • 1970-01-01
相关资源
最近更新 更多