Advertisement

02.26.2004 at 03:35PM PST, ID: 20899554
[x]
Attachment Details

Struts logic:iterate on multiple collections

Asked by snazzyrags in Java Server Pages (JSP)

Tags: struts, iterate

I have a logic:iterate block in my JSP file that needs to iterate over two Collections (ArrayList) simultaneously. That is:

           <logic:iterate id="products" name="displayProductsForm" property="productId" scope="session">
              <LI><a href="http://www.mydomain.com/myprog.cgi?p_id=<bean:write name="products" property="productId" />"> <bean:write name="products" property="productName" /></a></LI>
          </logic:iterate>

Problem is, the "property" attribute in the bean:write tag is in error (I put it in to try to describe what I am trying to do.) In other words, my ActionForm class has two ArrayLists (productName and productId) and I want to put a value from each in this single HTML line. As you can see, the user will see a product name link which, when clicked on, will take them to a product description page passing the product ID to a cgi script.

How do I code the iterate block? I can iterate over one property, but not two. As you're no doubt aware, I'm pretty new to Struts.Start Free Trial
 
 
[+][-]02.26.2004 at 03:41PM PST, ID: 10465284

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2004 at 06:04PM PST, ID: 10466085

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2004 at 06:15PM PST, ID: 10466133

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2004 at 06:28PM PST, ID: 10466191

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2004 at 06:31PM PST, ID: 10466204

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2004 at 08:47PM PST, ID: 10466667

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 07:24AM PST, ID: 10469929

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 08:24AM PST, ID: 10470454

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 01:38PM PST, ID: 10472841

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 01:52PM PST, ID: 10472967

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 03:04PM PST, ID: 10473410

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 03:10PM PST, ID: 10473446

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 08:27PM PST, ID: 10474571

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.27.2004 at 08:49PM PST, ID: 10474617

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.28.2004 at 06:15AM PST, ID: 10476001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.28.2004 at 06:26AM PST, ID: 10476030

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 08:36AM PST, ID: 10480714

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Server Pages (JSP)
Tags: struts, iterate
Sign Up Now!
Solution Provided By: kennethxu
Participating Experts: 4
Solution Grade: A
 
 
[+][-]02.29.2004 at 08:37AM PST, ID: 10480717

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 12:55PM PST, ID: 10481961

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.29.2004 at 02:11PM PST, ID: 10482278

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32