I'm using the OmniFaces FullAjaxExceptionHandler to display error pages. The error pages are shown correctly, but I'm having issues with the styling of those pages.
My application is using a template which has CSS classes defined on the body element. These classes are different for normal and error pages:
Normal page:
<h:body styleClass="main-body layout-compact">
Error page:
<h:body styleClass="exception-body error-page">
When the FullAjaxExceptionHandler processes an exception, a forward to the error page is performed (based on the <error-page>
mechanism in web.xml
). Apparently this does not rerender the <h:body>
tag, because when checking the HTML output, I can see that the <body>
tag still contains the CSS classes from the normal page (instead of the classes of the error page).
It seems that the content of the original <h:body>
is replaced with the content of the error page <h:body>
instead of just replacing the full <h:body>
. I don't know if this is default JSF / FullAjaxExceptionHandler behaviour.
Is there any way to have the <h:body>
rendered with the correct CSS classes? Moving the CSS classes away from <h:body>
is not an option.