Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to add an error page to a CQ5 project?

Avatar

Level 3

Hi,

I want to add an error page to a CQ5 project. In normal circumstances I would add

<error-page><exception-type>java.lang.Throwable</exception-type><location>/error.jsp</location></error-page>

 to the web.xml and in the error.jsp insert the 

<%@ page isErrorPage="true" %>

 How do I do it in CQ5?

Thank you.

Cheers,

Viren.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Take a look at this: http://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html
Works perfect and can be used in combination with setting the correct error pages in the dispatcher configurations in the vhost files.

Good Luck
/Johan

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

Take a look at this: http://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html
Works perfect and can be used in combination with setting the correct error pages in the dispatcher configurations in the vhost files.

Good Luck
/Johan

Avatar

Level 2

The error handling in CQ is done by specifying the error jsp as explained in article - http://helpx.adobe.com/cq/kb/CustomErrorHandling.html . This will take care of any exceptions/ errors occurring in your CQ application. However you may want to handle it differently for exceptions occurring in components, the error handling can be done at either component level or on page level by including this error jsp at relevant location/component jsp [

<%@ page errorPage="/apps/sling/servlet/errorhandler/Throwable.jsp" %>].