Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3053 Improve error reporting and logging
  3. MYFACES-3191

Handing exception (in exception handler) from render response phase with forward/redirect is inconsistent

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.2-SNAPSHOT
    • None
    • General
    • None
    • myfaces trunk

    Description

      View.xhtml snippet:
      <h:commandButton value="Submit">
      <f:setPropertyActionListener value="#

      {true}

      " target="#

      {bean.rendered}" />
      <f:ajax render="outputText" />
      </h:commandButton>
      <h:outputText rendered="#{bean.rendered}

      " id="outputText" value="#

      {bean.value}

      " />

      Bean.java snippet:
      public Object getValue() {
      throw new NullPointerException();
      }

      Custom exception handler code:
      if (PhaseId.RENDER_RESPONSE.equals(currentPhaseId)) {
      try

      { nav.handleNavigation(facesContext, null, "/ErrorPage.xhtml?faces-redirect=true"); }

      finally

      { i.remove(); }

      }
      Modify view and exception handler to achieve following combinations (HTML request = comment out f:ajax, forward = remove ?faces-redirect=true)

      1) HTML request + forward: nothing in log, and malformed output is produced (no closing tags for </body> etc.)

      2) HTML request + redirect: OK , redirect to ErrorPage.xhtml is done

      3) AJAX request + forward: exception in log, bud no forward to ErrorPage performed

      4) AJAX request + redirect: exception in log, malformed XML produced (<?xml and <partial-response 2x in output) , no redirect performed

      Attachments

        1. MYFACES-3191-alpha1.patch
          15 kB
          Martin Kočí

        Activity

          People

            Unassigned Unassigned
            markoc50 Martin Kočí
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: