Foren

ErrorPage Configuration

thumbnail
prabhakar reddy, geändert vor 9 Jahren.

ErrorPage Configuration

New Member Beiträge: 7 Beitrittsdatum: 01.08.13 Neueste Beiträge
Hi All,

I want too configure the custom pages for 404 , 403 and 500 errors in Liferay. can anyone have any idea?

Thanks,
thumbnail
Manali Lalaji, geändert vor 9 Jahren.

RE: ErrorPage Configuration

Expert Beiträge: 362 Beitrittsdatum: 09.03.10 Neueste Beiträge
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!
thumbnail
Jitendra Rajput, geändert vor 9 Jahren.

RE: ErrorPage Configuration

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
For other error codes like 500 you can add below entry in web.xml .

<error-page>
<error-code>500</error-code>
<location>/errors/500Error.jsp</location>
</error-page>


You need to create ext-plugin to over ride web.xml.
thumbnail
Tanweer Ahmed ., geändert vor 1 Jahr.

RE: ErrorPage Configuration

Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträge
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
thumbnail
prabhakar reddy, geändert vor 9 Jahren.

RE: ErrorPage Configuration

New Member Beiträge: 7 Beitrittsdatum: 01.08.13 Neueste Beiträge
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.
Mahesh Salunkhe, geändert vor 8 Jahren.

RE: ErrorPage Configuration

New Member Beiträge: 8 Beitrittsdatum: 05.09.12 Neueste Beiträge
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?