I've been adding more "exercises" to the Struts-EL exercise-taglib app, and I'm
finding some behavior I don't quite understand.
In the same JSP page, I have two "logic-el:iterate" loops, both of which
iterate through the same collection, the page attributes map ("${pageScope}").
One loop has an "html-el:button" in each iteration, and the other has a
"html-el:checkbox". Both of them set the "indexed" property to true ("${!empty
pageScope}" is always true). After seeing the generated HTML, I'm certain that
I'm unsure what I should expect for the "name" attribute in the generated HTML.
This is the "button" loop:
<logic-el:iterate collection="${pageScope}" id="item">
<html-el:button property="stringProperty" indexed="${!empty pageScope}"/>
</logic-el:iterate>
And this is what it generates for the first iteration:
<input type="button" name="stringProperty[0]" value="Click">
This is the "checkbox" loop:
<logic-el:iterate collection="${pageScope}" id="item">
<html-el:checkbox property="stringProperty" indexed="${!empty pageScope}"/>
</logic-el:iterate>
And this is what the first iteration generates:
<input type="checkbox" name="org.apache.struts.taglib.html.BEAN[0].stringProperty"
I have a small feeling that the placement of the "[0]" is expected, but I'm
pretty sure the odd bean name is unexpected.
Could someone help me understand what I should expect here, and what might be
going wrong if this is incorrect? If I know what I SHOULDN'T be seeing, I
could try to track it down a little more.
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>