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

clarify whether expression of binding-attribute of f:xxxxListener should be evaluated on postback

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 2.0 Rev a
    • Component/s: Lifecycle
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      320
    • Status Whiteboard:
      Hide

      EGEasy5 cat1 vdldoc changelog

      Show
      EGEasy5 cat1 vdldoc changelog

      Description

      for f:actionlistener the spec defines:

      'If binding is set, create a ValueExpression by invoking
      Application.createValueExpression() with binding as the expression argument,
      and Object.class as the expectedType argument. Use the ValueExpression to obtain
      a reference to the ActionListener instance. If there is no exception thrown, and
      ValueExpression.getValue() returned a non-null object that implements
      javax.faces.event.ActionListener, register it by calling addActionListener().
      If there was an exception thrown, rethrow the exception as a JspException.'

      According to this the instance returned by evaluation of the binding-expression
      would have to be used. It doesn't mention that it's legal to use a lazy-loading
      wrapper for optimization (as it is used in the RI).

      adding the instance of ActionListener that is returned from evaluation of the
      binding-expression to the ActionSource implementing UIComponent would result in
      this very instance being used on all subsequent postback-requests. In case the
      binding-expression references e.g. a request-scoped managed bean the listener
      would reference the outdated instance on postback because the binding-expression
      would not be reevaluated again.

      Since this is undesirable behaviour the spec should either specify that the
      binding-expression has to be reevaluated on every request, or that the Listener
      being referenced must not be an object in request-scope.

      definitions of f:phaselistener and f:valuechangelistener face the same issue.

      (The RI makes use of a ActionListener-wrapper that evaluates the binding lazy.
      In conjunction with client-side statesaving it would reevaluate the binding
      expression on every request. With serverside-statesaving it would cache and
      return the same instance later, which is inconsistend - I've filed issue # 656
      (https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=656) against the RI
      to trak this.)

        Activity

        Hide
        Ed Burns added a comment -

        vdl

        Show
        Ed Burns added a comment - vdl
        Hide
        Ed Burns added a comment -

        Fixed

        Show
        Ed Burns added a comment - Fixed
        Hide
        Ed Burns added a comment -

        These are valid 2.0 Rev a issues

        Show
        Ed Burns added a comment - These are valid 2.0 Rev a issues
        Hide
        rogerk added a comment -

        changelog

        Show
        rogerk added a comment - changelog
        Hide
        Manfred Riem added a comment -

        Closing resolved issue out

        Show
        Manfred Riem added a comment - Closing resolved issue out

          People

          • Assignee:
            javaserverfowner
            Reporter:
            ntruchsess
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: