You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryce Fischer <br...@berzerker-soft.com> on 2003/09/20 04:39:15 UTC
logic:iterate problem
Basic question, should be easy, but I"m obviously missing something easy.
Trying to iterate through a java.lang.Set collection that I have put in
my session. My jsp will display the header information, but nothing else.
This is my jsp. It is a tile, so what you see below is the complete
content file (tried with and without the type parameter):
[BEGIN CODE]
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<table>
<tr><th>Center</th><th>Title</th><th>Total</th></tr>
<logic:iterate id="centerItem" name="browseCenters" type="com.berzerkersoft.bisweb.db.ejb.value.CenterBrowseValue">
<tr>
<td><bean:write name="centerItem" property="center"/></td>
</tr>
</logic:iterate>
</table>
[END CODE]
Below is a fragment of my Action class. Note the System.out.println,
where I print out the values. This is outputing the expected output.
[BEGIN CODE]
Set browseCenters = getBrowseCenters(userView.getUsername());
Iterator itr = browseCenters.iterator();
while (itr.hasNext()) {
CenterBrowseValue browseValue = (CenterBrowseValue)itr.next();
System.out.println(browseValue);
}
session.setAttribute(IConstants.BROWSE_CENTERS_KEY, browseCenters);
return mapping.findForward(FORWARD_browse);
[END CODE]
--
Bryce Fischer <br...@berzerker-soft.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: logic:iterate problem
Posted by Bryce Fischer <br...@berzerker-soft.com>.
uhh.. Never mind. Figured it out. Told you all it would be something
stupid.
Forgot to add the <%@ taglib uri="/tags/struts-bean" prefix="bean"%>...
Sorry to waste bandwidth.
--
Bryce Fischer <br...@berzerker-soft.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: logic:iterate problem
Posted by Bryce Fischer <br...@berzerker-soft.com>.
To partially answer my own question, I changed this:
> <table>
> <tr><th>Center</th><th>Title</th><th>Total</th></tr>
> <logic:iterate id="centerItem" name="browseCenters" type="com.berzerkersoft.bisweb.db.ejb.value.CenterBrowseValue">
> <tr>
> <td><bean:write name="centerItem" property="center"/></td>
> </tr>
> </logic:iterate>
> </table>
to read:
<table>
<tr><th>Center</th><th>Title</th><th>Total</th></tr>
<logic:iterate id="centerItem" name="browseCenters" type="com.berzerkersoft.bisweb.db.ejb.value.CenterBrowseValue">
<tr>
<td>Element Value: <bean:write name="centerItem" property="center"/></td>
</tr>
</logic:iterate>
</table>
and I get the exact number of "Element Value: " outputs, but no output
from the bean tag.... So something must be wrong with the bean tag or
the way I have my id declared...
--
Bryce Fischer <br...@berzerker-soft.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org