I want to "page" (break into segments) a HTML table.
I iterate through the table entries with the JSTL <forEach> tag.
My paging logic is encapsulated in a class where I maintain the itemsCollection and the current page indexes. I have two buttons on the
JSP page for the user to scroll the itemsCollection forward or backward.
The problem is that the scrolling function will
skip every other scroll group. Example: There are 15 items in the collection. The table initially display items 1 thru 5. Click the Next button and items 11 thru 15 are displayed. Click the Prev button and items 1 thru 5 are displayed. Items 6 thru 10 are skipped. Moreover, this problem is intermittent. Sometimes items 6 thru 10
will display in either the forward or backward direction, but I can't predict or control when that will happen.
I'm pretty sure this is not a fault in my paging logic. I've tracked it in the debugger, and what happens when a segment is skipped is that the JSP page is never rendered. The
Struts action is called again as if the page had been rendered and the Next button had been clicked, but of course that did not happen (at least there doesn't seem to be any telltale flicker of the screen as I would expect to see if the page were rendered again). My action class returns only one mapping, "Success", and that maps to the JSP page in question.
What I've tried so far is substituted JSTL's <c:url> tags for the <html:link> tags, but that made no difference. Any help?