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

The View Metadata tag is not processed unless at least one <f:viewParam> is defined

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Lifecycle
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

    • Issuezilla Id:
      872
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      Section 2.2.1 of the JSF 2 spec requires that if no view-parameters exist in the
      view-metadata, that the render response phase be invoked immediately following
      the current phase on a GET request. This prevents custom metadata from being
      provided that may require lifecycle processing (view-actions, for example.)

      This is a hindrance to creating custom metadata-since even if a tool (such as
      prettyfaces) wishes to add custom url-parameter handling (or custom action
      invocation), it must also add an empty view-param in order to trigger the
      lifecycle. Also, not many people expect this behavior, since it is relatively
      counter-intuitive.

      I propose defining a new contract that would allow for individual meta-data
      components to determine whether or not the full lifecycle should be invoked:

      public interface ViewMetadata {
      /**

      • If true, the full faces lifecycle will be invoked; if false, the
      • lifecycle will skip directly to render-response, unless another
      • {@link ViewMetadata}

        object requests that the lifecycle be executed.
        */
        public boolean requiresLifecycle();
        }

      This new contract would still honor the behavior of previous implementations,
      and should be mostly backwards compatible (because unless the custom tag
      requests the lifecycle, it will still be skipped.)

      The current spec verbiage:

      2.2.1 - "If the request is not a postback, try to obtain the
      ViewDeclarationLanguage from the ViewHandler, for the current viewId. If no such
      instance can be obtained, call facesContext.renderResponse(). Otherwise, call
      getViewMetadata() on the ViewDeclarationLanguage instance. If the result is
      non-null, call createViewMetadata() on the ViewMetadata instance. Call
      ViewMetadata.getViewParameters(). If the result is a non-empty Collection, do
      not call facesContext.renderResponse(), otherwise do call
      facesContext.renderResponse(). If it turns out that the previous call to
      createViewMetadata() did not create a UIViewRoot instance, call createView() on
      the ViewHandler. Call renderResponse() on the FacesContext."

        Activity

        Hide
        lincolnbaxter added a comment -

        I'd like to revise my proposal; I now oppose my original suggestion of adding a
        new interface:

        Solution:

        It's possible we could just get away with changing the verbiage a little bit in
        order to resolve this issue, thereby avoiding changes to any existing, or adding
        any new APIs. (Note the **starred** change.) The change is very subtle, and
        not very invasive, but perfectly addresses this situation.

        The current spec verbiage:

        2.2.1 - "If the request is not a postback, try to obtain the
        ViewDeclarationLanguage from the ViewHandler, for the current viewId. If no such
        instance can be obtained, call facesContext.renderResponse(). Otherwise, call
        getViewMetadata() on the ViewDeclarationLanguage instance. If the result is
        non-null, call createViewMetadata() on the ViewMetadata instance. ***Call
        ViewMetadata.getViewParameters()***. If the result is a non-empty Collection,
        do not call facesContext.renderResponse(), otherwise do call
        facesContext.renderResponse(). If it turns out that the previous call to
        createViewMetadata() did not create a UIViewRoot instance, call createView() on
        the ViewHandler. Call renderResponse() on the FacesContext."

        Proposed verbiage:

        2.2.1 - "If the request is not a postback, try to obtain the
        ViewDeclarationLanguage from the ViewHandler, for the current viewId. If no such
        instance can be obtained, call facesContext.renderResponse(). Otherwise, call
        getViewMetadata() on the ViewDeclarationLanguage instance. If the result is
        non-null, call createViewMetadata() on the ViewMetadata instance. ***Call
        ViewMetadata.getChildren()***. If the result is a non-empty Collection, do not
        call facesContext.renderResponse(), otherwise do call
        facesContext.renderResponse(). If it turns out that the previous call to
        createViewMetadata() did not create a UIViewRoot instance, call createView() on
        the ViewHandler. Call renderResponse() on the FacesContext."

        Show
        lincolnbaxter added a comment - I'd like to revise my proposal; I now oppose my original suggestion of adding a new interface: Solution: It's possible we could just get away with changing the verbiage a little bit in order to resolve this issue, thereby avoiding changes to any existing, or adding any new APIs. (Note the ** starred ** change.) The change is very subtle, and not very invasive, but perfectly addresses this situation. The current spec verbiage: 2.2.1 - "If the request is not a postback, try to obtain the ViewDeclarationLanguage from the ViewHandler, for the current viewId. If no such instance can be obtained, call facesContext.renderResponse(). Otherwise, call getViewMetadata() on the ViewDeclarationLanguage instance. If the result is non-null, call createViewMetadata() on the ViewMetadata instance. ***Call ViewMetadata.getViewParameters()***. If the result is a non-empty Collection, do not call facesContext.renderResponse(), otherwise do call facesContext.renderResponse(). If it turns out that the previous call to createViewMetadata() did not create a UIViewRoot instance, call createView() on the ViewHandler. Call renderResponse() on the FacesContext." Proposed verbiage: 2.2.1 - "If the request is not a postback, try to obtain the ViewDeclarationLanguage from the ViewHandler, for the current viewId. If no such instance can be obtained, call facesContext.renderResponse(). Otherwise, call getViewMetadata() on the ViewDeclarationLanguage instance. If the result is non-null, call createViewMetadata() on the ViewMetadata instance. ***Call ViewMetadata.getChildren()***. If the result is a non-empty Collection, do not call facesContext.renderResponse(), otherwise do call facesContext.renderResponse(). If it turns out that the previous call to createViewMetadata() did not create a UIViewRoot instance, call createView() on the ViewHandler. Call renderResponse() on the FacesContext."
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Ed Burns added a comment -

        Bulk assign all of Sheetal's spec issues to me.

        Show
        Ed Burns added a comment - Bulk assign all of Sheetal's spec issues to me.
        Hide
        arjan tijms added a comment -

        I think this is an exact duplicate of JAVASERVERFACES_SPEC_PUBLIC-762.

        Show
        arjan tijms added a comment - I think this is an exact duplicate of JAVASERVERFACES_SPEC_PUBLIC-762 .
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          People

          • Assignee:
            Unassigned
            Reporter:
            lincolnbaxter
          • Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: