Bug 50408

Summary: Scoped EL variable in methodexpression is treated as Object
Product: Tomcat 7 Reporter: balusc <balusc>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 7.0.5   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description balusc 2010-12-03 12:37:00 UTC
Consider following example:

  <c:forEach items="${pageContext.response.headerNames}" var="name">
    <c:forEach items="${pageContext.response.getHeaders(name)}" var="value">

The ${name} is a String. The ${name.class.name} also proves that. The getHeaders(name) call however results in:

org.apache.jasper.el.JspELException: /test.jsp(23,12) '${pageContext.response.getHeaders(name)}' java.lang.NoSuchMethodException: org.apache.catalina.connector.ResponseFacade.getHeaders(java.lang.Object)

Another example which also results in NoSuchMethodException which suggests that an Object is been passed as argument:

<c:set var="name" value="test" />

This works all fine on Glassfish v3.
Comment 1 Mark Thomas 2010-12-03 16:51:47 UTC
Thanks for the report and the code snippet. That made reproducing this and generating a test case much easier.

This has been fixed in 7.0.x and will be included in 7.0.6 onwards.