I want to write a condition in the offset attribute of logic:iterate tag in struts1.3. My tag looks like this
logic:iterate name=”instlist” id=”inst” type=”com.umonitor.fundstransfer.beans.FtInstitution” indexId=”counter”
I want to set the offset value to every 8th element in the list.
Is that possible? I wanted to implement paging but the problem is I cant change the action class or add any but only manipulate the values in the jsp. I have the complete list in the jsp and have to display 8 rows only in the page.
Have you looked at the ‘offset’ and ‘length’ attributes of logic:iterate? http://struts.apache.org/1.x/struts-taglib/tlddoc/logic/iterate.html
These attributes will enable you to start at a certain position (offset) and then show only the next 8 entries (length).
In your case I guess you have a parameter called something like ‘page’ and you’ll need to set the offset to page*8 and the length to 8.