Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 2.3
    • Component/s: Lifecycle
    • Labels:
      None

      Description

      Exception handling for phase listeners behaves differently depending on if they are registered globally in faces-config.xml or with f:phaseListener for a particular view root.

      In the first (global) case any exception thrown by them gets forwarded to an exception handler as described in the spec.

      In the second (per view root) case all exceptions get logged and swallowed as described in the UIViewRoot documentation.

      This inconsistent behavior adds increased complexity when implementing PhaseListeners. Ideally both cases should forward any exception to the exception handler so they can be handled there.

      See also the discussion of the problem in: https://java.net/jira/browse/JAVASERVERFACES-2985

        Issue Links

          Activity

          Hide
          pnicoluc added a comment -

          Proposed solution:

          http://docs.oracle.com/javaee/7/api/javax/faces/component/UIViewRoot.html#encodeBegin-javax.faces.context.FacesContext-

          Update UIViewRoot.encodeBegin(FacesContext context) javadoc by removing the
          following text:

          "Any errors that occur during invocation of any of the the beforePhase
          listeners must be logged and swallowed."

          Update UIViewRoot.encodeEnd(FacesContext context) javadoc by removing the
          following text:

          "Any errors that occur during invocation of the afterPhase
          listener must be logged and swallowed. "

          Then an update to the implementation would need to be made to publish the
          exceptions being thrown by the beforePhase and afterPhase of the
          PhaseListeners rather than having them logged and swallowed.

          Show
          pnicoluc added a comment - Proposed solution: http://docs.oracle.com/javaee/7/api/javax/faces/component/UIViewRoot.html#encodeBegin-javax.faces.context.FacesContext- Update UIViewRoot.encodeBegin(FacesContext context) javadoc by removing the following text: "Any errors that occur during invocation of any of the the beforePhase listeners must be logged and swallowed." Update UIViewRoot.encodeEnd(FacesContext context) javadoc by removing the following text: "Any errors that occur during invocation of the afterPhase listener must be logged and swallowed. " Then an update to the implementation would need to be made to publish the exceptions being thrown by the beforePhase and afterPhase of the PhaseListeners rather than having them logged and swallowed.
          Hide
          Ed Burns added a comment -

          Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          Show
          Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

            People

            • Assignee:
              Ed Burns
              Reporter:
              frederickkaempfer
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: