Is it possible to overload an EL method in JSF 1.1 using Facelets as your view handler? If so, how?
For example, I have this code defining my EL methods (which are defined in namespace k):
public static String doStuff( String s ) {
return doStuff( null, s );
}
public static String doStuff( Map<String,String> m, String s ) {
...
return something;
}
When I try to call #{k:doStuff("hey!")} from my Facelets page, I get this error:
Function 'k:doStuff' specifies 2 params, but 1 was declared
It looks like the problem was with how it was declared. For example, I was using this to declare my methods:
and using the following configuration:
However, the
this.addFunction()is essentially callingput()on a java.util.Map object so that duplicate methods can’t be added since the keys are the same betweendoStuff.To solve this problem, I’ll have to explicitly declare the methods in the *.taglib.xml unless anyone knows of a way to dynamically solve the problems.