Any ideas on how I can pass array (String ...) in a taglib function in JSP?
If variable arguments where supported you would have to define the function in the TLD like this:
but that gives the following error:
The class java.lang.String... specified in the method signature in TLD for the function formTags:testFunction cannot be found.
It is expecting a fully qualified class name as parameter.
The proof can actually be found in the jsp2.0 specs:
JSP.C.1XML Schema for TLD, JSP 2.0 <xsd:element name="function-signature" type="j2ee:string">
Provides the signature, of the static Java method that is
to be used to implement the function. The syntax of the
function-signature element is as follows:
FunctionSignature ::= ReturnType S MethodName S? '(' S? Parameters? S? ')'
ReturnType ::= Type
MethodName ::= Identifier
Parameters ::= Parameter | ( Parameter S? ',' S? Parameters )
Parameter ::= Type
* Type is a basic type or a fully qualified Java class name (including package name), as per the 'Type' production in the Java Language Specification
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com