Liferay 在最大化 portlet 时创建的后退箭头中生成空白 URL

Liferay is generating a blank URL in the back arrow that is created when a portlet is maximized

当 portlet 最大化时 (p_p_state=maximized),Liferay 生成一个后退箭头以允许导航回到 "full page"。

但是,生成的标记中的 HREF 为空。没有URL。这不会发生在我的本地机器上,但它会发生在我的服务器上(本地和服务器是 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 包的本地机器上它很好 - 所以我很确定环境中有些不同。

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

在服务器中部署后,您需要更新重定向 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