Beruflich Dokumente
Kultur Dokumente
status
DONE
Usefull links
<IfModule disp_apache2.c>
# All your existing configuration
DispatcherPassError 1
</IfModule>
3. In AEM/CQ, override the default error handler script and create custom error
pages (described in next section Application level error handling)
Then configure your ErrorDocument in httpd.conf which will point to custom error
page. This directive specifies mapping - which content page should be displayed
when error with specific status code occurs
<LocationMatch \.html$>
ErrorDocument 404 /404.html
#ErrorDocument <ANY OTHER ERROR CODE>
<PATH IN YOUR DOCROOT>
</LocationMatch>
<LocationMatch /content/tenant1>
ErrorDocument 404
/content/tenant1-404.html
ErrorDocument 403
/content/tenant1-403.html
</LocationMatch>
<LocationMatch /content/tenant2>
ErrorDocument 404
/content/tenant2-404.html
ErrorDocument 403
/content/tenant2-403.html
</LocationMatch>
<LocationMatch /content>
ErrorDocument 404
/content/fallback404.html
ErrorDocument 403
/content/fallback403.html
</LocationMatch>
With above configuration if someone request a page, that may lead to any of above error
code, in that case page will be served by CQ dispatcher and not by Publish instance. This
will also avoid unnecessary load on publish instance.
For more information about Error handling (technical implementation concept and
detailed description) check the confluence page here
eon-aem-foundation\foundation-core
Package name
com.eon.aem.foundation.errorhandling
Mock-up Content
errorhandler-mock-content.zip
Mock-up Configuration
errorpagehandler-mock-config.zip
eon-aem-foundation
Inside the eon-aem-foundation a package has been created that can be reused by all projects and contains the implementation of application
level error handling functionality.
errorpagehandler-mock-config.zip contains example error handler configuration, which works with provided example content. It has to be
adjusted to your project needs.
errorhandler-mock-content.zip contains example content for testing application level error handling. It works with basic Geometrixx and
Geometrixx Outdoor project, which are always included in AEM instance after installation.
We need to adjust Felix build plugin because Configuration Manager bundle wants to use higher version of org.apache.sling.api.resource
API then AEM 6.0 provides (it wants to use version which is provided in AEM6.1)
All these steps needs to be done because Configuration Manager is an AEM6.1 functionality but EON uses AEM 6.0
/conf
+ global
+ settings
+ errorPages (Global error page configuration is used if there is no
tenant configuration defined)
- 404 => points to global 404 error page
- 403 => points to global 403 error page
- 500 => points to global 500 error page (this is a fallback error
page if error pages are not defined for the occurring error)
+ eon.de (tenant)
+ settings
+ errorPages
- 404 => points to 404 error page in German project
- 403 => points to 403 error page in German project
- 500 => points to 500 error page in German project (this is a
fallback error page if error pages are not defined for the occurring error)
+ eon.sw (tenant)
+ settings
+ errorPages
- 404 => points to 404 error page in Sweden project
- 403 => points to 403 error page in Sweden project
- 500 => points to 500 error page in Sweden project (this is a
fallback error page if error pages are not defined for the occurring error)
Example configuration can be found in errorpagehandler-mock-config.zip which works with example content package and its purpose is to
demonstrate how application level error handling works
/content
+ jcr:content
- cq:conf = "/conf/global"
+ eon.de
+ jcr:content
- cq:conf = "/conf/eon.de
+ eon.sw
+ jcr:content
- cq:conf = "/conf/eon.sw"
Example cq:conf configuration on Geometrixx and Geometrixx Outdoors project root node can be found in errorhandler-mock-content.zip pac
kage. It is used for demonstration how application level error handling can be used.