I want to use a tld function which is simply implemented, MyAccessManager being an abstract class and having 2 children overriding a function differently:
public static <T extends MyAccessManager> boolean isAllowed(T accessMan, MyTypeEnum otherUsersEnum){
// trivial implementation
}
I defined above method also in my tld definition file (*.tld).
I have 2 classes which extends my MyAccessManager and I am using function via EL like:
<input name="foo" type="hidden" value="${mytaglib:isAllowed(param1, param2)}"/>
I pass right parameters (ie children class instances as param1) to my tld function but webapp throws below exception:
org.apache.jasper.JasperException: PWC6300: The class T specified in the method signature in TLD for the function mytaglib:isAllowed cannot be found. T
My tld file:
<function>
<description>Processes users access to specific resources</description>
<name>isAllowed</name>
<function-class>com.myproj.MyUtil</function-class>
<function-signature>boolean isAllowed(T,com.myproj.MyTypeEnum)</function-signature>
</function>
Does TLD not support java's Type Parameters? Or, is there any way to implement such a functionality?