I asked a similar question a few months back. It appears that pagination
is considered business-logic by some and view by others.
Personally, I found that the following approach worked really well for
me (it was a struts application):
- I considered pagination part of the business logic
- I created some java utility methods to calculate the different
"ranges" for the pages, based on the number of items I have to manage
(in particular, I can handle nicely the case where there are just a few
items and I don't need pagination at all). Also, I could have easily
made page size parametric too.
- I exported the range value as Context parameters
- in the JSP view I used JSTL variables to access the parameters and
build navigation links between pages without any scriptlets
this was powerful, simple and flexible, but then again, that was just me.
Luca
Post by e***@swapsimple.comPost by P PrabaharanHello all,
I am in the urgent position to implement pagination in struts. I am not in the position to use custom tags.becoz already many pages were made. I need to catch all the records and do pagination.If any one have code then please send to me. thanks to all
Thanks&Regards
P.Prabaharan
Assuming this is a non-html response of some kind (since pagination of
an html page doesn't make any sense), you might want to take a look at
writing a filter using the Filter interface and the <filter> tag in
your web.xml. That, however, has nothing to do with the standard taglibs
so if you need help with that you should go ask on some other list.