Hi, 
we've been using the pager tags for a while on a prototype, and I'd like to
extend them with a "first" and "last" tag. We're also doing queries which bring
back many thousands of results. We'll be tuning our SQL later, but it works
fine. Did you put your results in a session attribute?

Also, I'm sure you can nest tags, but I think they have to be written to allow
the jsp compiler to interpret the body rather than just copy it. I need
desperately to get into writing tags to clean up our pages, and the pager taglib
fiddling might just be the intro I need.

As for putting the index above the results, maybe you could have an empty loop
to count the results, show the index, use the pager properties pagerOffset and
pagerMaxItems to display the just results for the current page in a second loop,
and then have a second index below. It does kind of defeat some of the logic
built into the pager tags, though, and it's a bit inefficient.
It's designed for arbitrary iterations, but it would be nice though to be able
to tell it how many things you're display without having to loop through it all,
but it seems fast enough for now. 

Matthew.

 > ----------------------------------------------------------------------
 > Date: Mon, 12 Feb 2001 15:36:05 -0700 (MST)
 > To: [EMAIL PROTECTED]
 > From: Steve A Drake <[EMAIL PROTECTED]>
 > Subject: Re: paging for web application
 > Message-ID: <[EMAIL PROTECTED]>
 > 
 > On Wed, 31 Jan 2001, Peter Alfors wrote:
 > 
 > > check out the pager taglib:  http://jsptags.com/tags/navigation/pager/
 > 
 >  Actually, I can run the example that comes with the distribution but am
 > having some problems using this pager taglib in Struts. The links created
 > by the pager aren't working.
 > 
 >  The example I'm working on has a JSP with an embedded form that, upon
 > submission, invokes a database query and reads back the results stored in
 > request scope beans (to the same JSP). The pager creates the correct
 > number of links to result pages. For example, one link created is:
 > 
 > http://localhost/project/simpleQuery.jsp?pager.offset=1
 > 
 > But when I click on this link I only get my simple query form and the
 > pager output of:
 > 
 > Result Pages [<<Prev] 1
 > 
 > but no other results. I've also tried typing in the URL:
 > 
 > http://localhost/project/simpleQuery.do?pager.offset=1
 > 
 > with the same result (or lack there-of).
 > 
 >  Ideas? Any help is appreciated!
 >  Sorry if this is off-topic for Struts.
 > 
 > ------------------------------
 > 
 > Date: Mon, 12 Feb 2001 17:25:18 -0700 (MST)
 > To: [EMAIL PROTECTED]
 > From: Steve A Drake <[EMAIL PROTECTED]>
 > Subject: Re: paging for web application
 > Message-ID: <[EMAIL PROTECTED]>
 > 
 > On Mon, 12 Feb 2001, Steve A Drake wrote:
 > 
 > > On Wed, 31 Jan 2001, Peter Alfors wrote:
 > > 
 > > > check out the pager taglib:  http://jsptags.com/tags/navigation/pager/
 > > 
 > >  Actually, I can run the example that comes with the distribution but am
 > > having some problems using this pager taglib in Struts. The links created
 > > by the pager aren't working.
 > 
 >  Well, I did get this working but with a couple of major caveats. 
 > 
 > 1) In order to define a given <pg:index>, I had to use scriptlets for all
 > the code between the start and end tag. I assume this is because - from
 > what someone enlightened me earlier with - you can't nest tags. I hope
 > I'm wrong about this because it significantly clutters up the JSP and 
 > renders all the bean tags unusable. =:|
 > 
 > 2) I needed to locate the hypertext index at the bottom of the document
 > because the index dimensions are determined as the results are iterated. I
 > assume this could be fixed by buffering the output to a StringBuffer or
 > somesuch but havn't tried that yet.
 > 
 > If anyone has some usage suggestions for this pager taglib, I'd
 > appreciate your input.
 > 

Reply via email to