Re: paging for web application

2001-02-14 Thread Matthew Harrison

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 [< 
 > 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 , 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.
 > 



Re: paging for web application

2001-02-12 Thread Steve A Drake

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 , 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.




Re: paging for web application

2001-02-12 Thread Steve A Drake

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 [

Re: paging for web application

2001-02-12 Thread Steve A Drake

On Wed, 31 Jan 2001, Peter Alfors wrote:

> check out the pager taglib:  http://jsptags.com/tags/navigation/pager/

 Very handy! For anyone else looking at this for paging long-winded
result sets, and using Tomcat 4.0-b1, I needed to edit the demo
"pager-demo.jsp" and change:



to:




This fixes a hack put in to convert "20" to an int as delineated in the
pager troubleshooting section.




Re: paging for web application

2001-02-01 Thread JamesW


Misak,

I've found the pager tag that James over at http://www.jsptags.com has
developed is quite powerful and usable. I've used it in some prototypes
using Struts and Tomcat. One of my colleagues attempted to get it to work
under Weblogic without much luck, but we didn't spend much time on it. Now
I'm just waiting for him to make the taglib that generates his menu
available :-)

Here's the link http://jsptags.com/tags/navigation/pager

This topic does beg the question whether Struts should have its own paging
tags... I suspect you can probably implement paging with the standard logic
and iteration tags though...

Regards,
James W.

--
This e-mail is from Cards Etc Pty Ltd (ACN: 069 533 302). It may contain
privileged and confidential information. It is intended for the named
recipient(s) only. If you are not an intended recipient, please notify us
immediately by reply e-mail or by phone on +61 2 9212 7773 & delete this
e-mail from your system.
--





Re: paging for web application

2001-01-31 Thread Peter Alfors

check out the pager taglib:  http://jsptags.com/tags/navigation/pager/


"Boulatian, Misak" wrote:

> Hi alI,
>
> I am trying to implement paging for web application. The query may return
> over thousand records and it is a bad idea to dump all of those to the
> client. I was thinking to feed only 50 records at a time and have client to
> click for next or previous page. We are using struts with EJBs. Our action
> classes call session EJBs, which return information as a javabean. Does
> anyone have any ideas or done anything with struts in regards to paging (it
> may not even have to do anything with struts).
>
> I appreciate any responses.
> Thanks,
> Misak


begin:vcard 
n:;
x-mozilla-html:FALSE
org:http://www.irista.com/logo/irista.gif">Bringing Vision to Your Supply Chain
adr:;;
version:2.1
end:vcard