users@javaserverfaces.java.net

JSF 1.2 Phase Listeners and Exceptions

From: Butash, Bob <bob.butash_at_eds.com>
Date: Tue, 25 Sep 2007 12:56:33 -0400

Hello,

I'm trying to convert a JSF 1.1 application to leverage JSF 1.2. In my
application I have made it available that phase listeners can thrown an
exception. I than catch that exception in my lifecycle's execute method
where I handle it. It appears with JSF 1.2 a questionable coding
practice was introduced in that exceptions are now merely logged and
then eaten. Here is the code that I'm referring to:


catch (Exception e) {
            if (LOGGER.isLoggable(Level.WARNING)) {
                LOGGER.warning("phase("
                               + phaseId.toString()
                               + ','
                               + context
                               +
                               ") threw exception: "
                               + e
                               + ' '
                               + e.getMessage()
                               +
                               "\n"
                               + Util.getStackTraceString(e));
            }
            // move the iterator pointer back one
            if (listenersIterator.hasPrevious()) {
                listenersIterator.previous();
            }
        }

I know that the spec states that the after phase should be invoked,
however is eating exceptions the right move here???

Thanks for your thoughts