Iteration loop counter in JSTL tag

Posted on 2011-10-20
Medium Priority
Last Modified: 2012-05-12
<table class="TableBackgroundDB">
                    <tr class="TableHeaderRow">

                <c:forEach var="product" items="${res.product}" varStatus="rowCounter">
                      <c:when test="${rowCounter.count % 2 == 0}">
                        <c:set var="rowStyle" value="odd" />
                        <c:set var="rowStyle" value="even" />
              <portlet:renderURL var="searchProductURL">
                <portlet:param name="action" value="viewProduct" />
                <portlet:param name="spec" value="${product.Specification}" />
                    <tr class="${rowStyle}">
                    <td><a href="${searchProductURL}">${product.name}</a><td>


Name    Specification
product                       product.ss1
Question by:Newton21205
  • 3
  • 2
LVL 16

Assisted Solution

by:Bryan Butler
Bryan Butler earned 2000 total points
ID: 37003529
Are you sure ${res.product} has more than the one product?  Can you output the values to check?

Author Comment

ID: 37003605
for now i have one product in database and im trying to display its properties in table format.

Author Comment

ID: 37003646
one product object in res.product. i'm trying to display properties of this object.
LVL 16

Accepted Solution

Bryan Butler earned 2000 total points
ID: 37018300
items="${res.product}" must not be right.  What about just:


Author Closing Comment

ID: 37134673

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question