Affects Version/s: 2.0.2, 2.0.4, 2.1.0, 2.1.1, 2.1.2
Fix Version/s: None
In the issue #2059 I reported that some desirable functionality would be implemented for more comfortable work. Then, I read in the JSF 2.1 specification that not only this is desirable, but even required. So, I decided to report it again - this time as a bug.
Section 6.2 "Exception Handler" clearly states that all exceptions but ValidationException, ConverterException, MissingResourceException from <f:loadBundle /> and exceptions from @PreDestroy must not be swalled. However, encodeBegin() and encodeEnd() methods of javax.faces.component.UIViewRoot swallow every exception. Furthermore, this behavior is intended according to comments upon those methods:
*(...) Any errors
- that occur during invocation of any of the the beforePhase
- listeners must be logged and swallowed.(...)
This contradicts to what the specification says.
Since during the render phase <phaseListener />'s are called only then, and not in the doPhase() method (inherited by com.sun.faces.lifecycle.RenderResponsePhase from com.sun.faces.lifecycle.Phase), any exception coming from beforePhase or afterPhase (implementation of javax.faces.event.PhaseListener interface) is swallowed and not passed to the exception handler.
P.S. I am afraid I cannot delete the issue #2059.