View RSS Feed

JSP

TagExtraInfo Class

Rate this Entry
by
JSP
, 01-01-2012 at 06:26 PM (1618 Views)
A TagExtraInfo class gives out certain extra data or information regarding the attributes of tags to the JSP container, at translation time.

• Returns information or data regarding the scripting variables which is made available by the tag to the remaining JSP page for use. Following method is used.

Java Code:
VariableInfo[] getVariableInfo(TagData td)

<html>
<myTag:addObjectsToArray name=”myArray” />
<myTag:displayArray name=”myArray” />
</html>
The manipulation of the attribute myArray without using TagExtraInfo is not possible. Reason is that myArray object is not placed at the page. pageContext.getAttribute() can still be used however it might not be a cleaner approach to cast to object type correctly, this is totally reliable on the designer of the page. For making items that are stored in pageContext, the TagExtraInfo could be used through setAttribute() method which is available to scriptlet, as given below:
Java Code:
<html>
<myTag:addObjectsToArray name=”myArray” />
<%-- scriplet code %>
<% for(int i=0; i<myArray.length;i++){
        html += <LI> + myArray[i] + </LI>;
%>
</html>

Submit "TagExtraInfo Class" to Facebook Submit "TagExtraInfo Class" to Digg Submit "TagExtraInfo Class" to del.icio.us Submit "TagExtraInfo Class" to StumbleUpon Submit "TagExtraInfo Class" to Google

Updated 01-14-2012 at 06:08 PM by JSP

Categories
Uncategorized

Comments