Is there a way to intercept any and all exceptions in JSF within its
lifecycle? When we searched for clues, the only ones we found were
handling errors using JSP error pages, after FacesServlet has
completed.
What we'd like to do is have one class handle all exceptions that our
managed beans throw, intepret it, put in a FacesMessage on the
context, then show the prev page. Of course, showing the prev page is
already handled by JSF. We'd also like to have the chance to
influence navigation if possible.
We started with an ActionListener, like this:
<faces-config>
<application>
<action-listener>
com.employer.BadEmployeeActionListener
</action-listener>
</application>
</faces-config>
and we successfully intercepted bad employee activities caught or
ignored by action methods. Then we clicked on a <h:commandLink
actionListener="#{emp.actBad}"> and it bypassed our admins. The
#{emp.actBad} method got called and threw its exception even before
our AL's processAction() was called. It didn't even hear about the
emp's bad activity at all.
We want to catch them all, action="", actionListener="", and whatever
method on the backing beans called through the usual JSF channels.
If not standard JSF, maybe something Shale adds support for? Even if
not directly, is there something that we can hook into or extend that
will allow us to do this?
We're using Java 1.4 & JSF 1.1
Thanks in advance.
Hubert