What is the best way to implement pagination yet maintaining the Spring MVC methodology? Also, the dataset will not be coming from a database, it will be a hashmap that is set via the controller. Does anyone have any suggestions?
laura mccord wrote:What is the best way to implement pagination yet maintaining the Spring MVC methodology? Also, the dataset will not be coming from a database, it will be a hashmap that is set via the controller. Does anyone have any suggestions?
You mean to say it would fetch the data from database for only time?
Well, my code is a listing of files/folders that are contained in a given directory path, so a database is not involved. But, once I retrieve all the contents load it in a HashMap, my controller sends the hashmap to my jsp page. I've seen so many examples that are using a database but I haven't seen anything where it's just a list or hashmap. So, I was wondering if this has been done before so I don't have to recreate the wheel.
I actually haven't completed yet.I got sidetracked and I need to accomplish one more thing before I start messing with layout. I was just trying to get suggestions so I know what to start researching. I'll definitely post my result once I finish this step.
I have used the DisplayTag earlier. If you google the forums you will find that it has been used with Spring MVC quite a bit.
Just download the sample WAR from display tag team , and see if the level of pagination supported in the examples suits your requirements (they have many examples showing various levels of customization to the tag).
What i liked about the tag is that it accepts a partial list (only what is to be displayed on the page) , this is a huge gain in terms of memory.
Check it out..
OCMJEA/SCEA, SCDJWS, SCBCD 1.3, SCJP 1.4
My SCEA experience:http://javalogue.blogspot.com/