MyFaces Core
  1. MyFaces Core
  2. MYFACES-2363

ExceptionHandler implementation requires deal with ajax responses

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major 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
          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
          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
          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
          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
          Jakob Korherr added a comment -

          Here is my patch for this issue.

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

          Thanks to Jakob Korherr for provide this patch

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development