You're making a custom tag library and have defined an attribute:
test.tag:
<%@ attribute name="variableName" required="false" type="java.lang.String" %>
${variableName}
and have a class:
Test.java
public class Test {
public String getVariableName() {...};
public List<Test> getTests() {...};
}
and finally a jsp:
<s:iterator value="getTests">
<t:test />
</s:iterator>
While you have not specified a variableName in the <t:test />
tag, the tag is grabbing a value for variableName
from the Test object because it happens to share the same variable name.
How do you avoid this namespace collision?