Bug 56147

Summary: Problem Invoking overloaded methods using EL
Product: Tomcat 7 Reporter: ujjets
Component: Servlet & JSP APIAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 7.0.42   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description ujjets 2014-02-17 21:35:54 UTC
Using apache-tomcat-7.0.42 on Windows 7 64bit
 
Using the below code in JSP :

<c:forEach var="item" items="${listItems }">
    <p>${item.someMethod("h") }</p>
</c:forEach>

results in:

javax.el.ELException: Cannot convert h of type class java.lang.String to class java.lang.Class

I have the below methods :
       public void someMethod(String x) {
              someMethod(methodThatReturnClass(x))
       }

       public void someMethod(Class clz) {
              System.out.println("Class called");
       }
Comment 1 Mark Thomas 2014-02-20 13:15:24 UTC
I've confirmed that this is an issue with the latest 7.0.x trunk but not with 8.0.x.

It should be possible to port the fix from 8.0.x but I need to a) id the right patch and b) confirm that this isn't a side-effect of something that changed in the spec between EL 2.2 and EL 3.0.
Comment 2 Mark Thomas 2014-02-21 12:03:33 UTC
I've found the 8.0.x bug and have back-ported the fix to 7.0.x along with some supporting refactoring.

*** This bug has been marked as a duplicate of bug 55483 ***
Comment 3 ujjets 2014-02-24 17:50:53 UTC
Thank you.