Hi,
I am new to struts and I trying to use the logic iterate tag. The task
that I have to do is to loop through a collection and display some
properties.
I am obtaining the collection on my jsp page itself. The collection is made
of objects.
Here is how I obtain the collection:
<%
Collection uriLanguages=
UriFactory.getInstance().getUri("257").getUriLanguages().values();
%>
Below is how my iterate tag is defined:
<jsp:useBean id="uriLanguage" class="com.ford.hr.framework.uri.UriLanguage"
scope="request"/>
<logic:iterate id="uriLanguage" name="uriLanguages"
type="com.ford.hr.framework.uri.UriLanguage">
<tr>
<td align="left">
<html:link page="/logon.do"><bean:write name="uriLanguage"
property="linkLabel"/></html:link>
</td>
<td align="left">
<html:link page="/logon.do">Set as Default</html:link>
</td>
</tr>
</logic:iterate>
I have two questions regarding this.
1.Do I have to use the useBean tag to define "uriLanguage".If I don't
specify that I get the error message that uriLanguage is not defined in any
scope.
2.Am I using iterate tag correctly? After I started using the useBean tag I
no longer get exceptions, but I do not get the value for link label property
in uriLanguage class.
Thanks in advance for your help.