You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bill Schneider <bs...@vecna.com> on 2005/02/22 19:05:20 UTC

[OT] Re: Displaying mulitpage results

> By using good frameworks like iBATIS (which has great support for 
 > pagination and dynamic queries) and design patterns pertinent to
> the requirement, the code in the layers you can be kept to a minimum. 
> The web application at workeffort.dev.java.net does all kinds of 
> pagination, ordering sorting etc from the database. The methods for
> pagination in the struts actions is a few lines and the service layer
> method call is a one liner. There is no code bloat if you take the 
> time to design the different layers appropriately. 

Now that I remember, I think one of the major pain points for doing 
paging/sorting at the DB level with Hibernate and Struts together was 
needing to make a second query with "count(*)" to figure out how many 
total rows/pages there are.  If Hibernate gave you back a paginated 
results object that implemented Collection (and size() works), which I 
think iBATIS does, it would be cleaner.

Lazy-paginated collections may require the "open session in view" 
pattern to actually fetch the results from within a JSP page.  I'm not 
that fond of this personally (hangs onto db resources during potentially 
slow output rendering/transmission) but it seems to be the widespread 
accepted practice.

-- Bill
-- 
Bill Schneider
Chief Architect

Vecna Technologies
5004 Lehigh Rd., Suite B
College Park, MD 20740
bschneider@vecna.com
t: 301-864-7253 x1140
f: 301-699-3180

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org