Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      6

      Description

      I just discovered the new JUEL engine. Great!
      Unfortunately, JUEL 2.1.0-rc2 contains a stupid bug which also affects the engine.

      In JuelScriptEngine.toELContext(...) the default constructor of SimpleResolver
      is used to create the EL resolver. This constructor automatically creates a
      chain of delegates to resolve bean properties, array elements, mappled values, etc.
      Unfortunately, the resolver to handle list elements is missing here! This means,
      that you won't be able to evaluate $

      {list[42]}

      , if variable 'list' refers to a
      java.util.List.

      To fix this, either wait for the next JUEL release and replace the jar or -
      which I would prefer - create the chain of resolver delegates by hand:

      CompositeELResolver chain = new CompositeELResolver();
      chain.add(new ArrayELResolver());
      chain.add(new ListELResolver()); // !!!
      chain.add(new MapELResolver());
      chain.add(new ResourceBundleELResolver());
      chain.add(new BeanELResolver());
      ELResolver resolver = new SimpleResolver(chain);

        Activity

        Hide
        sundararajana added a comment -

        Fixed as suggested and verified that List[index] works.

        Show
        sundararajana added a comment - Fixed as suggested and verified that List [index] works.

          People

          • Assignee:
            scripting-issues
            Reporter:
            beckchr
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: