【发布时间】:2017-02-19 03:11:38
【问题描述】:
我想将用户重定向到自己的错误页面而不是默认的 liferay 错误页面。我使用的是 6.1.1 CE ga2。
我试过了
layout.show.http.status=true
layout.friendly.url.error=/error
在portal-ext中但没有运气。
【问题讨论】:
标签: liferay liferay-6 custom-error-pages
我想将用户重定向到自己的错误页面而不是默认的 liferay 错误页面。我使用的是 6.1.1 CE ga2。
我试过了
layout.show.http.status=true
layout.friendly.url.error=/error
在portal-ext中但没有运气。
【问题讨论】:
标签: liferay liferay-6 custom-error-pages
由于您尚未指定需要显示自定义错误页面的错误类型,因此我将其显示为 500。您可以为其他人实施。
在应用服务器web.xml中添加如下配置。
$TOMCAT_HOME/conf/web.xml
<error-page>
<error-code>500</error-code>
<location>/ErrorPages/Error500.jsp</location>
</error-page>
在错误页面中更改重定向。
你也可以通过 ext plugin 来实现。我从未尝试过。我会试着告诉你
【讨论】:
解决方案 1
显示错误页面:-
第 1 步:- 转到门户服务器
liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\ROOT\html
创建名为“error”的新文件夹
第 2 步:- 将附加图片 (accessDenied.png) 粘贴到新创建的路径中
liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\ROOT\html\error
第三步变化
portal-ext.properties
添加新令牌
layout.friendly.url.page.not.found=/html/error/accessDenied.png
第 4 步重新启动服务器。
如果出现错误代码 404,此解决方案将显示错误 png。
解决方案 2:-
tomcat-7.0.27\webapps
转到每个 portlet 的 WEB-INF 并编辑 web.xml 。 添加
<error-page>
<error-code>404</error-code>
<location>/images/accessDenied.png</location>
【讨论】: