General J2EE: need example of struts pagination
Hi, I have a formbean in a seesion, in my jsp I display all the rows using logic:iterate , please how to use jsptags or displtag to use pagination , please your help is appreciated. thank you.
- Posted by: majid abdel
- Posted on: July 06 2006 16:57 EDT
Majid, Have a look at the docs for the struts iterate tag (http://struts.apache.org/1.2.x/userGuide/struts-logic.html#iterate), paying particular attention to the offset and length attributes. Lets say you want 10 records per page - set offset to pageNumber * 10 (Assuming that, internally, pageNumber is zero based) and length to 10. Then provide some mechanism for displaying next/previous/specific page links which post the appropriate value back to the action. I hope this brief description makes sense to you, as I don't have time to provide code samples right now. Let me know if you need more help.
http://displaytag.sourceforge.net this is the best and easiest stuff;)
Are you the Bob Armour who worked at Probe back in the previous century? If so I'd love to get back in touch; you can contact me at paul dot sinnett at gmail dot com or look me up on the net. Cheers, Paul.