My web application must display a large number of records from a table in a relational database - by large I mean the table has approx. 1,000,000 rows and searches could return 1000's of records. Clearly, I can't do this with
EJB finder methods, so I have opted to implement the Value List Handler
pattern so that the client only ever has a page or two of results at a time. So far this hasn't been a problem, and I think it will be the ideal solution. Now, when I am displaying the table of records on a web page I would like to use some pre-existing tags to make things easier (specifically displaytag.sourceforge.net ). To use these tags you simply pass them a List or Iterator and they take care of the rest. Now the problem is that when implementing the Value List Handler pattern the client will get one page of results at a time, and if I simply pass this one page (usually a List) to the custom tags, the tag library will think that the one page represents all of the results and only allow the user to scroll through the one set. Hope this makes sense so far. Now my solution has been to write an Iterator, which exists at the client level, and under the hood it keeps grabbing new pages from the server and makes it look like one collection to the client. Does these seem like a reasonable solution? Problem I have had, is that when the page first loads (ie. displaying page 1) the tag library just keeps calling hasNext() on my iterator to figure out the size of the underlying collection. This defeats the whole purpose because my iterator will in-turn keep grabbing pages from the server. Any and all ideas are welcome. Thanks in advance.