https://issues.apache.org/bugzilla/show_bug.cgi?id=53792

          Priority: P2
            Bug ID: 53792
          Assignee: dev@tomcat.apache.org
           Summary: EL: AstValue.getTarget() mistakes a method invocation
                    for a property access
          Severity: normal
    Classification: Unclassified
          Reporter: adrian.m...@bedag.ch
          Hardware: PC
            Status: NEW
           Version: 7.0.27
         Component: Jasper
           Product: Tomcat 7

Trying to evaluate the method expression #{beanFactory.loginBean().init}

Expected behavior: lookup beanFactory, invoke its loginBean method and on its
return value, invoke the init method.

Actual behavior: the following exception is thrown: 
javax.el.PropertyNotFoundException: /LoginView.xhtml @9,101
listener="#{viewBeanFactory.loginBean().initIfGetRequest}": Property
'loginBean' not found on type
ch.bedag.redacted.InteractionLayer$$EnhancerByCGLIB$$1ea36cb9

Looking at the source, AstValue.getTarget(EvaluationContext) only checks
whether the last child is an instanceof AstMethodParameters, but in this
expression there is an additional method invocation expression before that ...

Presumably, the while loop 

            while (base != null && i < propCount) {
                property = this.children[i].getValue(ctx);
                ctx.setPropertyResolved(false);
                base = resolver.getValue(ctx, base, property);
                i++;
            }

should be something like:

            while (base != null && i < propCount) {
                if (i + 1 < propCount && this.children[i + 1] instanceof
AstMethodParameters) {
                    base = // result of method invocation
                    i += 2;
                } else {
                    property = this.children[i].getValue(ctx);
                    ctx.setPropertyResolved(false);
                    base = resolver.getValue(ctx, base, property);
                    i++;
                }
            }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to