Set tag attribute declare="true" for the outer tag & declare="false" for the inner
tag.


<%=currentItem%>

<%=currentItem%>



public class CurrentItemExtraInfo extends TagExtraInfo {
public VariableInfo[] getVariableInfo(TagData data)
{
String declare = data.getAttributeString("declare"); if (declare.equals("true")
{ return new VariableInfo[] {
new VariableInfo (declare,
"",
true,
VariableInfo.AT_BEGIN)
};
} else { return new VariableInfo[] {
new VariableInfo (declare,
"",
false,
VariableInfo.AT_BEGIN)
};
} }
}




jkwadzo@logisil.com (Jonathan) wrote:
>Hi,
>
>I have a loop tag LoopA which exposes a script variable currentItem
>using a TagExtraInfo class. I want another loop tag LoopB which is
>nested to LoopA to expose the same variable currentItem, which thus
>will refer the current Item in LoopB. I'm using the same TEI class.
>After compiling my JSP, I get an error of 'Duplicate declaration of
>variable currentItem'. Any idea?... Thanks!
>
>Jonathan