How to add an error page to a CQ5 project? | Community
Skip to main content
viren_pushpanay
Level 2
October 16, 2015
Solved

How to add an error page to a CQ5 project?

  • October 16, 2015
  • 2 replies
  • 1874 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ojjis

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

2 replies

Ojjis
OjjisAccepted solution
Level 7
October 16, 2015

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

Level 2
October 16, 2015

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" %>].