mgoutham22
asked on
paging in JSP using logic:iterate
I need program for paging in JSP using logic:iterate and struts ,and <b><h3> do not want to use the third party tags </b></h3>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i Knew that , but I am very much restricted in using the third party tags, Thanks any way.
Then best bet is to have a database based paging. In mysql u can make use of LIMIT clause and in Oracle you can make use of rownum.
ASKER
ok here is the the complete situation, I have a arraylist size is 20 and need to display 5 a page . it is not some thing related to the database.
I need to write a program using the logic iterate and struts action class.
I need to write a program using the logic iterate and struts action class.
ok. for such a small list..u don't really need db. try with the following
1st page
<logic:iterate id="element" name="someList" offset="1" length="5">
...
</logic:iterate>
2nd page
<logic:iterate id="element" name="someList" offset="6" length="5">
...
</logic:iterate>
and -.....
generate the pager links...and add offset as parameter to make a generalise handling.
1st page
<logic:iterate id="element" name="someList" offset="1" length="5">
...
</logic:iterate>
2nd page
<logic:iterate id="element" name="someList" offset="6" length="5">
...
</logic:iterate>
and -.....
generate the pager links...and add offset as parameter to make a generalise handling.
ASKER
The list size is not fixed.
ASKER
List size will be less than or equal to 20 .
there is no handling with the list size. Why do u have doubts with list size? Only thing we did is set the offset and length to display till 5.
ASKER
let me try it
the provided solution by me does work. Points should be awarded to me.
https://www.experts-exchange.com/questions/21777860/Paging-issues-for-Fargo.html
i helped someone to get it done. Please go thru it and let us know if u face problems.