Fórum

ErrorPage Configuration

thumbnail
prabhakar reddy, modificado 9 Anos atrás.

ErrorPage Configuration

New Member Postagens: 7 Data de Entrada: 01/08/13 Postagens Recentes
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, modificado 9 Anos atrás.

RE: ErrorPage Configuration

Expert Postagens: 362 Data de Entrada: 09/03/10 Postagens Recentes
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, modificado 9 Anos atrás.

RE: ErrorPage Configuration

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
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 ., modificado 1 Ano atrás.

RE: ErrorPage Configuration

Expert Postagens: 322 Data de Entrada: 11/03/10 Postagens Recentes
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, modificado 9 Anos atrás.

RE: ErrorPage Configuration

New Member Postagens: 7 Data de Entrada: 01/08/13 Postagens Recentes
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, modificado 7 Anos atrás.

RE: ErrorPage Configuration

New Member Postagens: 8 Data de Entrada: 05/09/12 Postagens Recentes
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?