I want to return ArrayList<HashMap<String,String>> in EL function with three String argument. How to do that?
You can use complex return types in your tld, too. E.g. this will work:
public static List<Map<String, String>> func(String arg1, String arg2,
String arg3) {
List<Map<String, String>> out = new ArrayList<HashMap<String, String>>();
// code code code
return out;
}
In your .tld file, you'll have to put this:
<function>
<description>Blah blah blah</description>
<name>func</name>
<function-class>your.package.YourClassName</function-class>
<function-signature>
java.util.List<java.util.Map<java.lang.String,java.lang.String>> func(java.lang.String,java.lang.String,java.lang.String)
</function-signature>
</function>
Caveats: As in this example, the angle brackets must be properly escaped in XML. The function signature must not be line wrapped. Non-unary generics, such as Map<String,String>, cannot be used as parameters. (Probably a tokenization bug.) You will have to go with the raw types there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With