In a tld I can specify a function where the return type uses generic syntax:
It seems to work as expected.
However, if I try to specify a function where the parameter uses generics:
the jsp page that uses the function returns an error:
HTTP Status 500 - The class java.util.List<java.lang.String> specified in the method signature in TLD for the function tt:upcaseStringList cannot be found. java.util.List<java.lang.String>
All the method does is take a List<String> and uppercase its elements.
Is this even currently possible? I've found references on the web saying that generics can't be used in a TLD, but I'm thinking they may be out of date, since it works for me, as described, with a generic return type.
Bear Bibeault wrote:Return types are not part of the method signature.
So the reason my first example worked, was that the return type specified in the <function-signature> tag wasn't wasn't checked anyway?
Testing, I have to specify a return type in <function-signature>, omitting it gives an error. However, if I have a hello() method that returns the string "hello", and yet I declare it in the tld as returning say an int
it all works and the jsp using the tag outputs "hello" to the browser!
But, just thinking about it, I'd be surprised if that was supported because with type erasure and all, it seems like it'd be difficult to impossible to implement (but I'm not an expert on that so take it with some salt)