struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilson, Les J SI-FSIA" <>
Subject RE: logic:iterate
Date Mon, 16 Dec 2002 08:20:50 GMT
Hi Cathy,

We use the jsptags pager as well and have not had any problems - we are
still using v1 of struts.  The jsp snippet below works without any blank
lines in the source - can't really see much difference between the two, only
the offset and the url seem to be different.

    <pg:pager maxPageItems="10" url="">
      <table cellspacing="0" cellpadding="2">
          <th width="30" align="left">
          <th width="90" align="left">
        <% boolean highlight = true; %>
        <strutslogic:iterate name="<%=CommonConstants.REFERENCE_DATA_LIST%>"

            <% highlight = !highlight; %>
            <tr <% if(highlight) { %> class="highlight" <% } %>>
                <strutshtml:link href="<%= "" +
idx %>">
                <strutslogic:present name="entry" property="description" >
                  <strutsbean:write name="entry" property="description" />
        <font class="pager">Result Pages:</font>
           <a class="pager" href="<%= pageUrl %>">[<< Prev]</a>
          <% if (pageNumber.intValue() < 10) { %>
          <% }
            if (pageNumber == pagerPageNumber) { %>
              <font class="pager"><%= pageNumber %></font>
          <% } 
          else { %>
            <a class="pager" href="<%= pageUrl %>"><%= pageNumber %></a>
          <% } %>
           <a class="pager" href="<%= pageUrl %>">[Next >>]</a>

Les Wilson

Shell Finance Services
Shell International Limited, Shell Centre, London SE1 7NA, United Kingdom

-----Original Message-----
From: Cathy []
Sent: 15 December 2002 19:02
To: Struts Users Mailing List
Subject: logic:iterate


Have you used pager tag library from
with logic:iterate tag? I am using them together, and I have a problem.
Please help me if you know what's going on in the following problem. I
really appreciate your help.(Rick suggested me to use display tag from I had a look. And it's excellent.
However, the project is almost in production phase, I prefer to fix the
problem based on what I have now instead of changing the implementation.
Thank Rick, anyway).

I retrieved 23 rows from Database, and I saved the data in session. I want
to display the data on 10 rows/page basis with page navigation ability.So on
the first page, there are 10 rows and a "next" link, On the second
page, there are 10 rows and  "previous" and "next" link. On the third page,
there are 3 rows and a "previous" link. I used logic:iterate to iterate
through the data, and use pager tag library from the above link to implement
the page navigation ability.The following is my jsp snippets:

<%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg" %>

<pg:pager maxPageItems="10" isOffset = "true">
   <logic:iterate id="aResult" name="results" scope="session"
                      <bean:write name="aResult" property="note"/>

             <logic:notEqual name="aResult" property="amount" value="0">
                     <bean:message key="amount.value"/></font></div>

    <-- page navigation area-->

Page navigation works fine(I mean when I click "next" or "previous", it goes
to next or previous page. So I omitted the page navigation snippest. The
problem is: when the first page is displayed, I viewed the source of the
first page, there are 10 blank rows before the line " <-- page navigation
area-->" -- I mean there is a big spaces which is equal to 10 rows, between
the last row and the line " <-- page navigation area-->". After I click
"next" link and opened the second page, I viewed the source, I found between
the last row on the page and  the line "<-- page navigation area-->", there
are 3 blank rows(because the next page has 3 rows). When I opened the third
page(last page), and viewed source, there is no blank row(because there is
no next page).

In order to solve the problem, I searched the archive and the web. I found
lot of disussion about paging. But there seems no discussion about the blank
rows problem. Could you help me out here. I spend a lot of time trying to
fix it, but no clue. I really appreciate your help.

Thank you very much.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message