javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-758

Support view actions that execute before tree is built w/ navigation support

    Details

    • Issuezilla Id:
      758
    • Status Whiteboard:
      Hide

      size_medium importance_large 20110201-tag

      Show
      size_medium importance_large 20110201-tag

      Description

      JSF should provide a view metadata component that defines a method expression to
      be invoked before the component tree is built (or restored), with support for
      navigating to an alternative view afterward using navigation rules. Navigation
      may be the result of a constraint violation, a security restriction, or because
      the request was for a pseudo-view.

      As an example, the developer might use a view action to load a blog entry before
      the view is displayed. If the entry cannot be found, the user would be
      redirected to another page using a navigation rule.

      <f:view>
      <f:metadata>
      <f:viewParam name="id" value="#

      {blogController.id}

      "/>
      <f:viewAction execute="#

      {blogController.loadEntry}" onPostback="false"/>
      </f:metadata>
      </f:view>

      <navigation-case>
      <from-action>#{blogController.loadEntry}

      </from-action>
      <from-outcome>false</from-outcome>
      <to-view-id>/entries.xhtml</to-view-id>
      <redirect/>
      </navigation-case>

      This feature relates to view parameters, as the example suggests. View
      parameters were introduced in JSF 2.0 to provide a declarative value binding
      between query string parameters and model properties. They go a long way towards
      accommodating the action-oriented scenario in JSF. But view actions are a
      necessary part of the equation.

      <f:event type="preRenderView"> is similar to <f:viewAction>, but is insuffient
      as a front controller. <f:event> gets you by if the purpose is to perform
      processing at the start of the request. <f:viewAction> is intended for when you
      have to perform logic to verify that the view can even be rendered. View-level
      security is one example. Another is verifying that preconditions are met. And
      the key is to make navigation away from the view an integrated part when it's
      determined that the view cannot and should not be rendered.

        Issue Links

          Activity

          Ed Burns logged work - 09/Jun/11 2:00 PM
          • Time Spent:
            3 hours, 37 minutes
             
            <No comment>
          Ed Burns logged work - 13/Jun/11 2:26 PM
          • Time Spent:
            1 hour, 30 minutes
             
            <No comment>
          Ed Burns logged work - 15/Jun/11 3:36 PM
          • Time Spent:
            4 hours, 37 minutes
             
            working on spec language
          Ed Burns logged work - 17/Jun/11 8:59 AM
          • Time Spent:
            30 minutes
             
            <No comment>
          Ed Burns logged work - 14/Dec/12 2:40 PM
          • Time Spent:
            20 minutes
             
            M jsf-ri/conf/share/facelets_jsf_core.tld

            - Add missing actionListener attribute.
            Sending jsf-ri/conf/share/facelets_jsf_core.tld
            Transmitting file data .
            Committed revision 11170.
          Ed Burns logged work - 31/Jan/13 5:54 AM
          • Time Spent:
            30 minutes
             
            SECTION: Modified Files
            ----------------------------
            M jsf-ri/src/main/java/com/sun/faces/lifecycle/RestoreViewPhase.java
            M jsf-api/src/main/java/javax/faces/view/ViewMetadata.java

            - Per discussion with Leonardo on EG, simplify lifecycle
              short-circuiting in the case of view metadata.

            M jsf-api/src/main/java/javax/faces/application/ResourceHandler.java

            - Per discussion with Leonardo on EG, require that createViewResource()
              can load views in flows.
            Sending jsf-api/src/main/java/javax/faces/application/ResourceHandler.java
            Sending jsf-api/src/main/java/javax/faces/view/ViewMetadata.java
            Sending jsf-ri/src/main/java/com/sun/faces/lifecycle/RestoreViewPhase.java
            Transmitting file data ...
            Committed revision 11511.

            People

            • Assignee:
              Ed Burns
              Reporter:
              mojavelinux
            • Votes:
              10 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Time Spent - 11 hours, 4 minutes Remaining Estimate - 1 week, 2 days, 23 hours, 10 minutes
                1w 2d 23h 10m
                Logged:
                Time Spent - 11 hours, 4 minutes Remaining Estimate - 1 week, 2 days, 23 hours, 10 minutes
                11h 4m