留言板
ErrorPage Configuration
Hi All,
I want too configure the custom pages for 404 , 403 and 500 errors in Liferay. can anyone have any idea?
Thanks,
I want too configure the custom pages for 404 , 403 and 500 errors in Liferay. can anyone have any idea?
Thanks,
Hi,
For 404 error,
You can create a hook and override the jsp portal-web\docroot\errors\404.jsp
Create a custom jsp : hooks\HookPlugin-hook\docroot\WEB-INF\custom_jsps\errors\404.jsp
and add below portal-ext.properties:
layout.show.http.status=true
layout.friendly.url.page.not.found=/errors/404.jsp
HTH!
For 404 error,
You can create a hook and override the jsp portal-web\docroot\errors\404.jsp
Create a custom jsp : hooks\HookPlugin-hook\docroot\WEB-INF\custom_jsps\errors\404.jsp
and add below portal-ext.properties:
layout.show.http.status=true
layout.friendly.url.page.not.found=/errors/404.jsp
HTH!
Hi Prabhakar,
Just in case you do not find the 404.jsp, you have to override /errors/code.jsp.
LR 6.2 uses code.jsp for displaying the Error messages of this kind.
-Tanweer
Just in case you do not find the 404.jsp, you have to override /errors/code.jsp.
LR 6.2 uses code.jsp for displaying the Error messages of this kind.
-Tanweer
Hi All,
For configure the custom error page for 403(forbidden error), we need to write a liferay hook.
/html/portal/status.jsp in side this jsp page we have code like this. Now we can write our custom message here.
<c:when test="<%= SessionErrors.contains(request, PrincipalException.class.getName()) %>">
<h3 class="alert alert-error">
<liferay-ui:message key="forbidden" />
</h3>
<liferay-ui:message key="you-do-not-have-permission-to-access-the-requested-resource" />
<br /><br />
<code class="lfr-url-error"><%= HtmlUtil.escape(url) %></code>
</c:when>
Thanks,
Prabhakar reddy.
For configure the custom error page for 403(forbidden error), we need to write a liferay hook.
/html/portal/status.jsp in side this jsp page we have code like this. Now we can write our custom message here.
<c:when test="<%= SessionErrors.contains(request, PrincipalException.class.getName()) %>">
<h3 class="alert alert-error">
<liferay-ui:message key="forbidden" />
</h3>
<liferay-ui:message key="you-do-not-have-permission-to-access-the-requested-resource" />
<br /><br />
<code class="lfr-url-error"><%= HtmlUtil.escape(url) %></code>
</c:when>
Thanks,
Prabhakar reddy.
My requirement is to show custom 'under construction page'
what i tried so far-
layout.show.http.status=true
layout.friendly.url.page.not.found=/html/portal/page_under_construction.html
I created page_under_construction.html and jpg image and put under folder '/ROOT/html/portal'.
Upto this, it's working fine.
How to get images outside tomcat/webapps/ as 'under construction' page/html is at some other drive e.g. 'D' or webapps of another tomcat?
Note - i have tried updating file 'server.xml' --> <host>-->
e.g.<context path="/foo/bar" docbase="D:/images"></context>
What is way to accomplish this?
what i tried so far-
layout.show.http.status=true
layout.friendly.url.page.not.found=/html/portal/page_under_construction.html
I created page_under_construction.html and jpg image and put under folder '/ROOT/html/portal'.
Upto this, it's working fine.
How to get images outside tomcat/webapps/ as 'under construction' page/html is at some other drive e.g. 'D' or webapps of another tomcat?
Note - i have tried updating file 'server.xml' --> <host>-->
e.g.<context path="/foo/bar" docbase="D:/images"></context>
What is way to accomplish this?