Ideal solution to pagination (long lists)?

2007-01-04 Thread Andrew Martin
I am interested to know the ‘best’ practice for navigating through long lists. 
At the moment we have implemented Struts-layout for this purpose. Our 
implementation currently retrieves the full dataset and uses Struts-layout 
sorting and navigation pager options to navigate through the results. However 
the drawback of this approach is in performance as our application will contain 
long lists.

I have read many articles and browsed many forums but haven’t yet been able to 
find a ‘best practice’ or ideal approach.

Andrew


Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Gareth Evans

Hi Andrew,

I suggest using displaytag with its external paging and sorting features

http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html

Gareth

Andrew Martin wrote:

I am interested to know the ‘best’ practice for navigating through long lists. 
At the moment we have implemented Struts-layout for this purpose. Our 
implementation currently retrieves the full dataset and uses Struts-layout 
sorting and navigation pager options to navigate through the results. However 
the drawback of this approach is in performance as our application will contain 
long lists.

I have read many articles and browsed many forums but haven’t yet been able to 
find a ‘best practice’ or ideal approach.

Andrew



--
Gareth Evans

Senior Developer

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

--
Tel:+44 (0)870 0100 704
Fax:+44 (0)870 9010 705
E-Mail: [EMAIL PROTECTED]
Web:www.msoft.co.uk

--
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
--
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Martin wrote:
 I am interested to know the ‘best’ practice for navigating through
 long lists.

I haven't used Struts-layout, so I'm not sure how my suggestion will
fit-in with your preferred display engine, but here goes, anyway.

We have a search application that uses Lucene as an index and a database
to store the actual data. Searches are performed using Lucene and then
the real data is fetched for display. Needless to say, many results may
be returned, so paging is necessary.

Lucene basically returns an list of record ids to us, which we store in
an array of ints, which is relatively small (even if /all/ records match
the query, we'll only get 15k of ids back). We wrap that list in a
paged record which contains a cache.

This paged record object has a getRecord method that first checks to
see if the record has already been loaded in the cache, and returns it
if it was there. If it's a cache miss, then the cache is emptied and we
load an entire page of records from the database to fill the cache.

This allows the pager to believe that it's iterating through a complete
list of data, while the underlying object is actually caching and
discarding data so that only the essentials are kept in memory (that is,
the complete list of record ids and the current page of full records).

We keep that object in the user's session so that page reloads don't
have to go back to the database and are nice and fast.

I hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFnQf19CaO5/Lv0PARAjO1AKC6iBQgG0LNlbfGpCbotNgxt2MCdwCgu7eJ
oSdgiNJCQu9PCWo5zB/vIHw=
=ewkK
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Tom Schneider

For struts2 tags, checkout
https://issues.apache.org/struts/browse/WW-1569

The problem I have with displaytag is that in an effort to satisfy 
everyone's needs, it is infinitely configurable.  IMHO, that makes it 
hard to figure out and hard to use.  The other issue we had with display 
tags is that with struts2, it isn't backed by a freemarker template.  
Every other built-in tag in struts2 is backed by a freemarker template, 
which is a much better solution to customization issue.  In the simple 
case, it will be simple, but it will also let you do the more 
complicated scenerio.


Also checkout http://forum.springframework.org/showthread.php?t=33012 if 
your using spring.

Tom

Gareth Evans wrote:

Hi Andrew,

I suggest using displaytag with its external paging and sorting features

http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html

Gareth

Andrew Martin wrote:
I am interested to know the ‘best’ practice for navigating through 
long lists. At the moment we have implemented Struts-layout for this 
purpose. Our implementation currently retrieves the full dataset and 
uses Struts-layout sorting and navigation pager options to navigate 
through the results. However the drawback of this approach is in 
performance as our application will contain long lists.


I have read many articles and browsed many forums but haven’t yet 
been able to find a ‘best practice’ or ideal approach.


Andrew






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Manos Batsis

Making a suggestion is difficult without knowing what tools/tiers or
other specifics are involved.

Our MD4J [1] generated DAOs return implementations of a Page interface
[2] for search queries. A Hibernate-based Page implementation [3] is
also available. This serves generic memory and DB access requirements
well (i.e. no caching on application level, only the results to be
rendered are retreived from the DB on each call).

[1] http://md4j.sourceforge.net/
[2]
http://md4j.cvs.sourceforge.net/md4j/md4j/src/java/com/geekologue/md4j/dao/Page.java?view=markup
[3]
http://md4j.cvs.sourceforge.net/md4j/md4j/src/java/com/geekologue/md4j/dao/hibernate/HbmQueryResultPage.java?view=markup

hth,

Manos

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Caroline Jen
Hi Andrew,

 I ran into similar problems.  Anoter developer on
the team wrote a tag. It extracts the paging
information and goes to the database table to find out
the total number of records.

 The tag retrieves and displays only the first
set of records in accordance with the paging
specification (say 10 records) together with links
labeled as 1, 2, 3, 4, 5, .. at the bottom of the
page.  And the tag goes to the database table to find
and display the next set of records in accordance with
the specific link that is subsequently clicked by the
user.

 The problem is that the tag works only in the
session scope and also suffers performance hit when
accommodating large number of users who are online
simutaneously.

 Is there any better solution?

-Caroline
--- Gareth Evans [EMAIL PROTECTED] wrote:

 Hi Andrew,
 
 I suggest using displaytag with its external paging
 and sorting features
 

http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
 
 Gareth
 
 Andrew Martin wrote:
  I am interested to know the ‘best’ practice
 for navigating through long lists. At the moment we
 have implemented Struts-layout for this purpose. Our
 implementation currently retrieves the full dataset
 and uses Struts-layout sorting and navigation pager
 options to navigate through the results. However the
 drawback of this approach is in performance as our
 application will contain long lists.
  
  I have read many articles and browsed many forums
 but haven’t yet been able to find a ‘best
 practice’ or ideal approach.
  
  Andrew
  
 
 -- 
 Gareth Evans
 
 Senior Developer
 
 MSoft eSolutions Limited
 Technology Centre
 Inward Way
 Rossmore Business Park
 Ellesmere Port
 Cheshire
 CH65 3EN
 
 -- 
 Tel:+44 (0)870 0100 704
 Fax:+44 (0)870 9010 705
 E-Mail: [EMAIL PROTECTED]
 Web:www.msoft.co.uk
 
 --
 Terms:
 Please note that any prices quoted within this
 e-mail are subject to VAT.
 All program details and code described in this
 e-mail are subject to
 copyright © of MSoft eSolutions Limited and remain
 the intellectual
 property of MSoft eSolutions Limited.
 Any proposal or pricing information contained within
 this e-mail are
 subject to MSoft eSolutions' Terms and Conditions
 --
 Disclaimer:
 This message is intended only for use of the
 addressee. If this message
 was sent to you in error, please notify the sender
 and delete this
 message. MSoft eSolutions Limited cannot accept
 responsibility for viruses,
 so please scan attachments. Views expressed in this
 message do not
 necessarily reflect those of MSoft eSolutions
 Limited who will not
 necessarily be bound by its contents.
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]