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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development