You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Shawn Sohl <SS...@HNTB.com> on 2001/10/05 17:46:14 UTC

Iterate/Select Tags

I have searched for example on how to use these tags and I have come up
empty.  Can some one point to some great documentation
with real world examples on how to use these tags.

If not here is my scenario.  I am passing a Vector to a JSP page and inside
that vector is a number of beans.  So this code
is not working

<jsp:useBean id="testlist" class="java.util.Vector" scope="request" />

<logic:iterate id="test" collection="<%=testlist%>">
		<tr>
		   <td>Job</td>
		   <td><bean:write name="test" property="txtJob" /> </td>
 		   <td>Job Title</td>
		   <td><bean:write name="test" property="txtJobTitle" />
</td>
	</logic:iterate> 

One question is how does the iterate tag know which bean to use.  Dont I
have to define a bean object that states the type
of bean that is inside of the vector.

In regards to "Select/Options" tags, I need all kinds of help.  I need to
know everything from setting up my Form objects to 
using the "Select" tag to loop through a vector of bean objects and populate
the values............

Please Help!


This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are NOT the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. 


Re: Iterate/Select Tags

Posted by Ted Husted <hu...@apache.org>.
The best place to post a question like this is the Struts User list. 

Shawn Sohl wrote:
> 
> I have searched for example on how to use these tags and I have come up
> empty.  Can some one point to some great documentation
> with real world examples on how to use these tags.
> 
> If not here is my scenario.  I am passing a Vector to a JSP page and inside
> that vector is a number of beans.  So this code
> is not working
> 
> <jsp:useBean id="testlist" class="java.util.Vector" scope="request" />
> 
> <logic:iterate id="test" collection="<%=testlist%>">
>                 <tr>
>                    <td>Job</td>
>                    <td><bean:write name="test" property="txtJob" /> </td>
>                    <td>Job Title</td>
>                    <td><bean:write name="test" property="txtJobTitle" />
> </td>
>         </logic:iterate>
> 
> One question is how does the iterate tag know which bean to use.  Dont I
> have to define a bean object that states the type
> of bean that is inside of the vector.
> 
> In regards to "Select/Options" tags, I need all kinds of help.  I need to
> know everything from setting up my Form objects to
> using the "Select" tag to loop through a vector of bean objects and populate
> the values............
> 
> Please Help!
> 
> This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are NOT the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited.