using <logic:iterate>

T

tallan

Hi,
Im trying to iterate through my collection and seem to have an error i
cant solve.

this is my code:

<logic:iterate id="ccbin" name="ccBinBlockerForm" property="ccbinArray">

<bean:write name="ccbin" property="ccbinNum" filter="true"/>
<bean:write name="ccbin" property="binStatusCD" filter="true"/>
</logic:iterate>

i created a getter/setter for ccbinArray and made sure i've populated it
with an object 'CCBinBlocker'

im getting this error:

javax.servlet.jsp.JspException: No collection found
at
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:281)


Can someone help me, PLEASE??!
 
S

Sudsy

tallan said:
Hi,
Im trying to iterate through my collection and seem to have an error i
cant solve.

this is my code:

<logic:iterate id="ccbin" name="ccBinBlockerForm" property="ccbinArray">

<bean:write name="ccbin" property="ccbinNum" filter="true"/>
<bean:write name="ccbin" property="binStatusCD" filter="true"/>
</logic:iterate>

i created a getter/setter for ccbinArray and made sure i've populated it
with an object 'CCBinBlocker'

im getting this error:

javax.servlet.jsp.JspException: No collection found
at
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:281)

So here's roughly what the generated code would look like:

Collection c = ccBinBlockerForm.getCcbinArray();

So what's the method signature for getCcbinArray? It's obviously not a
Collection, hence the error. Read the javadocs. Here's a good place to
start:
<http://struts.apache.org/userGuide/struts-logic.html#iterate>
 
T

tallan

Hi,
getCCBinArray() returns an ArrayList. can i give the id of the iterate
any name i want?
 
P

Paul Lutus

tallan said:
Hi,
getCCBinArray() returns an ArrayList. can i give the id of the iterate
any name i want?

Can you use a few more words to convey your request? Can you offer a code
sample, even if in pseudo-code, so we can discover what you want?
 
T

tallan

basically I just want to know if in this code:

<logic:iterate id="strategy" name="maintainStrategysForm"
property="strategys">

does it matter what 'iterate id' is? can i name it anything or is it
dependent on another name?
 
T

tallan

basically I just want to know if in this code:

<logic:iterate id="strategy" name="maintainStrategysForm"
property="strategys">

does it matter what 'iterate id' is? can i name it anything or is it
dependent on another name?
 
S

Sudsy

tallan said:
basically I just want to know if in this code:

<logic:iterate id="strategy" name="maintainStrategysForm"
property="strategys">

does it matter what 'iterate id' is? can i name it anything or is it
dependent on another name?

You don't want to call it the same as something else, but otherwise
you're free to call it what you wish. You access it internally by
specifying the same name (strategy in your example) as the name
attribute of the contained tags.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top