javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-3205

Postback executes <f:event type="preRenderView"> listeners of another view when current view contains h:link which uses includeViewParams

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.25, 2.1.28, 2.2.5
    • Fix Version/s: 2.2.7
    • Labels:
      None
    • Environment:

      Windows 7 64-bit, Jetty

      Description

      When creating a link with an outcome that resolves to a page and using the includeViewParams, the preRenderView event of the target page will be attached to the current viewroot during the first render phase.
      On any postback of the first page, the preRenderView listener of the target page will be executed on the preRenderView event trigger of the first page. Even if the postback has nothing to do with the target page.
      In our case, the preRenderView event is used to check if the viewParams have a correct value, and an exception is thrown on any postback of the first page.

      See also https://java.net/jira/browse/JAVASERVERFACES-2158

      Attached is an example of 2 pages with 2 beans showing the issue. The first.xhtml page contains a bit of an explanation of how the problem is triggered.
      I conducted extra tests against the most recent versions of JSF 2.1 and 2.2

      It doesn't matter if you use an outcome defined in a NavigationCase in faces-config or just the name of the target view as outcome.

        Issue Links

          Activity

          Hide
          Manfred Riem added a comment -

          Can you please send the reproducer zip to issues@javaserverfaces.java.net? Thanks!

          Show
          Manfred Riem added a comment - Can you please send the reproducer zip to issues@javaserverfaces.java.net? Thanks!
          Show
          Ed Burns added a comment - Safe to close when < http://slc03qna.us.oracle.com:7070/hudson/view/Mojarra%202.2.x/job/2_2_x-gf-3_1_2_2-no-cluster/605/ >, < http://slc03qna.us.oracle.com:7070/hudson/view/Mojarra%202.2.x/job/2_2_x-gf-3_1_2_2-development-pss-client/658/ > and friends, < http://slc03qna.us.oracle.com:7070/hudson/view/Mojarra%202.2.x/job/2_2_x-gf-4_0-production-fss-server/836/ > and friends and < http://hudson-sca.us.oracle.com/view/MOJARRA_ALL/job/MOJARRA_2_2X_ROLLING_GLASSFISH_3_1_2_2_NO_CLUSTER/462/ > are clean.
          Hide
          Ed Burns added a comment -

          Must revert, fails these two tests:

          com.sun.faces.test.agnostic.facelets.core.Issue2260IT.testViewParamPassing
          com.sun.faces.test.agnostic.facelets.core.Issue2718IT.testDefaultStateless

          Show
          Ed Burns added a comment - Must revert, fails these two tests: com.sun.faces.test.agnostic.facelets.core.Issue2260IT.testViewParamPassing com.sun.faces.test.agnostic.facelets.core.Issue2718IT.testDefaultStateless
          Hide
          Ed Burns added a comment -

          SECTION: Modified Files
          ----------------------------
          M jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java
          M test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java

          • Revert fix pending investigation of these failures:

          com.sun.faces.test.agnostic.facelets.core.Issue2260IT.testViewParamPassing
          com.sun.faces.test.agnostic.facelets.core.Issue2718IT.testDefaultStateless
          Sending jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java
          Sending test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java
          Transmitting file data ..
          Committed revision 13095.

          Show
          Ed Burns added a comment - SECTION: Modified Files ---------------------------- M jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java M test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java Revert fix pending investigation of these failures: com.sun.faces.test.agnostic.facelets.core.Issue2260IT.testViewParamPassing com.sun.faces.test.agnostic.facelets.core.Issue2718IT.testDefaultStateless Sending jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java Sending test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java Transmitting file data .. Committed revision 13095.
          Hide
          Ed Burns added a comment -

          Committed to 2.2.x

          SECTION: Modified Files
          ----------------------------
          M jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java
          M test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java

          • Have to back this out again due to test failure.
            Sending jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java
            Sending test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java
            Transmitting file data ..
            Committed revision 13117.
          Show
          Ed Burns added a comment - Committed to 2.2.x SECTION: Modified Files ---------------------------- M jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java M test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java Have to back this out again due to test failure. Sending jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java Sending test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java Transmitting file data .. Committed revision 13117.
          Hide
          Ed Burns added a comment -

          Committed to 2.2.x

          SECTION: Modified Files
          ----------------------------
          M jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java
          M test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java

          • Have to back this out again due to test failure.
            Sending jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java
            Transmitting file data .
            Committed revision 13118.
          Show
          Ed Burns added a comment - Committed to 2.2.x SECTION: Modified Files ---------------------------- M jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java M test/agnostic/facelets/core/src/test/java/com/sun/faces/test/agnostic/facelets/core/Issue3205IT.java Have to back this out again due to test failure. Sending jsf-ri/src/main/java/com/sun/faces/application/view/ViewMetadataImpl.java Transmitting file data . Committed revision 13118.
          Show
          Ed Burns added a comment - Safe to close when < http://slc03qna.us.oracle.com:7070/hudson/view/Mojarra%202.2.x/job/2_2_x-gf-4_0-no-cluster/373/ >, < http://slc03qna.us.oracle.com:7070/hudson/view/Mojarra%202.2.x/job/2_2_x-gf-4_0-production-fss-client/841/ > and friends, < http://slc03qna.us.oracle.com:7070/hudson/view/Mojarra%202.2.x/job/2_2_x-gf-3_1_2_2-no-cluster/625/ > and friends, and < http://hudson-sca.us.oracle.com/view/MOJARRA_ALL/job/MOJARRA_2_2X_ROLLING_GLASSFISH_3_1_2_2_NO_CLUSTER/490/ > are clean.
          Hide
          Ed Burns added a comment -

          All required jobs are clean.

          Show
          Ed Burns added a comment - All required jobs are clean.

            People

            • Assignee:
              Ed Burns
              Reporter:
              Ben.Winkeler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 1 minute
                5h 1m