On 21/06/2010 15:16, John Wu wrote:
Hi Mark, I just got a chance to test it on the Beta release. It's still broken, with a slightly different exception message.
Confirmed. I'm pretty sure JSF is doing the right thing here and that I need to read the spec more carefully. I'll post an update when I have a fix.
Mark
javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: /helloWorld.xhtml @15,85 action="#{helloWorldController.doSomething(helloWorldModel)}": Method not found: [email protected]() The previous attached project is still valid as a test case. John Wu markt-2 wrote:On 10/06/2010 14:42, John Wu wrote:Hi Mark, The fix of "to derive the type directly from the value which ..." sounds not a solution. In a slightly more complex scenario, the fix still fails. Say the method signature is "public * theMethod(TheSupperType o)" and calling the method in EL like "#{theClassInstance.theMethod(theDerivedTypeInstance)}", where the supper type can be a supper class or an interface, your fix fails.super has one p, not two. I looked at the current code and the spec again. There is no need for any of this complexity. The exact types are defined when the method expression is created. I'm not sure why I was trying to derive them at invocation time when they were already available. I have added a test case, modified the implementation and checked the new code with the EL TCK and all looks to be OK. MarkExample project attached. My suggestion as to the solution of resolving which method to call: . Retrieve all methods of *theClassInstance*, and put them into the CANDIDATES collection; // Search a match by method name . For each method in CANDIDATES, . if the name is not *theMethod*, remove it from CANDIDATES . If CANDIDATES is empty, then NOT-FOUND; . else if only one is left, then FOUND; // Search a match by params count . else, count the number of actual params, . For each method in CANDIDATES, . if the number of formal params does not match that of actual params, remove it from CANDIDATES . // Optoional, handle cases of "method has variable number of arguments" . If CANDIDATES is empty, then NOT-FOUND; . else if only one is left, then FOUND; // Search a match by param types . else, evaluate all actual params; . For each method in CANDIDATES, . if NOT( for-each formalParamType.isAssignableFrom(actualParamType) ), remove it from CANDIDATES . // Optoional, handle cases of "method has variable number of arguments" . If CANDIDATES is empty, then NOT-FOUND; . else if only one is left, then FOUND; . else, AMBIGUOUS John Wu http://old.nabble.com/file/p28843317/jsf-2.0-el-2.2.testcase-v2.zip jsf-2.0-el-2.2.testcase-v2.zip--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
