hello Sourin,
I just seen an example showing the use of <variable> tag in the TLD. I hope this will help you to clera your doubts , atleast little bit
This question is from Enthuware mock
You are using a tag library with prefix "generator", which supports a tag named "random". This tag generates a random number and sets it to a variable named "value". Which of the following will output this value in the page?
1. <generator:random>value</generator:random>
2. <generator:random><%=value%></generator:random>
3. <generator:random><% int value;%> <%=value%></generator:random>
4. None of the above.
the correct option is 2. the explaination given is
The variables that are set by the custom tag are defined in customtag TagExtraInfo class. For example, in this case, the ExtraInfo impl for this tag should return an array of VariableInfo objects, an object of which will be same as:
new VariableInfo("value", "
String", true, VariableInfo.NESTED);
true => a new variable 'value' will be declared.
NESTED => Between the start tag and the end tag.
Another way to specify that a custom tag exposes a variable to the JSP page is through the <tag> element of the TLD. For example, the TLD for the above tag may contain:
<tag>
...
<variable>
<name-given>value</name-give>
<variable-class>java.lang.Double</variable-class>
<scope>AT_BEGIN</scope>
</variable>
</tag>
</tag>
I guess you can ignore some of initial details about classes and all.