Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2363

ExceptionHandler implementation requires deal with ajax responses

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-beta
    • Component/s: JSR-314
    • Labels:
      None

      Description

      See jsf 2.0 spec section 13.3.7

      "....Implementations must ensure that an ExceptionHandler suitable for writing exceptions to the partial response is installed if the current request required an Ajax response (PartialViewContext.isAjaxRequest() returns true)..."

      ".... Implementations may choose to include a specialized ExceptionHandler for Ajax that extends from javax.faces.context.ExceptionHandlerWrapper, and have the javax.faces.context.ExceptionHandlerFactory implementation install it if the environment requires it ....."

        Issue Links

          Activity

          Hide
          jakobkorherr Jakob Korherr added a comment -

          Spec says that we may include a specialized ExceptionHandler for partial request and have the ExceptionHandlerFactory install it.

          The problem with this solution is that when the developer uses a custom ExceptionHandlerFactory to install a custom ExceptionHandler which throws an Exception in its handle() method (e.g. PreJsf2ExceptionHandlerFactory), we cannot use our partial request ExceptionHandler and thus cannot respond correctly to partial requests.

          So we have to use the ErrorPageWriter (introduced in MYFACES-2454) to decide which error output should be generated.

          Show
          jakobkorherr Jakob Korherr added a comment - Spec says that we may include a specialized ExceptionHandler for partial request and have the ExceptionHandlerFactory install it. The problem with this solution is that when the developer uses a custom ExceptionHandlerFactory to install a custom ExceptionHandler which throws an Exception in its handle() method (e.g. PreJsf2ExceptionHandlerFactory), we cannot use our partial request ExceptionHandler and thus cannot respond correctly to partial requests. So we have to use the ErrorPageWriter (introduced in MYFACES-2454 ) to decide which error output should be generated.
          Hide
          jakobkorherr Jakob Korherr added a comment -

          FYI: I already have a solution for this issue, but I need my latest patch for MYFACES-2454 to be committed first.

          Show
          jakobkorherr Jakob Korherr added a comment - FYI: I already have a solution for this issue, but I need my latest patch for MYFACES-2454 to be committed first.
          Hide
          jakobkorherr Jakob Korherr added a comment -

          Here is my patch for this issue.

          Show
          jakobkorherr Jakob Korherr added a comment - Here is my patch for this issue.
          Hide
          lu4242 Leonardo Uribe added a comment -

          Thanks to Jakob Korherr for provide this patch

          Show
          lu4242 Leonardo Uribe added a comment - Thanks to Jakob Korherr for provide this patch

            People

            • Assignee:
              lu4242 Leonardo Uribe
              Reporter:
              lu4242 Leonardo Uribe
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development