MyFaces Core
  1. MyFaces Core
  2. MYFACES-1579

VariableResolver throws IllegalStateException because scope is unknown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.0
    • Component/s: JSR-252
    • Labels:
      None

      Description

      VariableResolverImpl tries to determine if it was invoked through the faces chain or jsp chain by looking for an attribute (Scope.getClassName()) in the RequestMap. However, that attribute is only set during the span of a call to FacesCompositeELResolver.getValue(). See FacesCompositeELResolver#invoke(), which calls setScope() and then unsetScope().

      Therefore the following code always throws IllegalStateException

      VariableResolver resolver = application.getVariableResolver();
      Object result = resolver.resolveVariable(facesContext, "param");

      because when VariableResolverImpl.resolveVariable() looks for the scope in the request map (which happens outside the getValue() call) its always null.

        Activity

        Matthias Weßendorf made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Matthias Weßendorf made changes -
        Affects Version/s  1.2.0 [ 12312576 ]
        Affects Version/s 1.2.0-SNAPSHOT [ 12311938 ]
        Fix Version/s 1.2.0-SNAPSHOT [ 12311938 ]
        Fix Version/s  1.2.0 [ 12312576 ]
        Mathias Broekelmann made changes -
        Fix Version/s 1.2.0-SNAPSHOT [ 12311938 ]
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mathias Broekelmann made changes -
        Assignee Mathias Broekelmann [ mbroekelmann ]
        Paul McMahan made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Paul McMahan made changes -
        Field Original Value New Value
        Attachment MYFACES-1579.patch [ 12354479 ]
        Paul McMahan created issue -

          People

          • Assignee:
            Mathias Broekelmann
            Reporter:
            Paul McMahan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development