Subject: Getting a value from the request object for variable for a custom tag?
From: "Preston Crawford" <[EMAIL PROTECTED]>
 ===
I'm writing a custom pager for a resultset my company needs to page through.
I don't return every record, just the amount and set indicated by page size
and page number in the query. But I also want to return the total number
found.

So what I do, is in my action I make two calls..

        request.setAttribute("ARRAYLIST_OF_STUFF", myCollection);
        request.setAttribute("NUMBER_FOUND", intFound);

Now in the JSP page I forward to I retrieve ARRAYLIST_OF_STUFF to iterate
using the logic:iterate tag. However, here is the tricky part. I want to use
the number found as part of the pager tag. The reason being that the pager
tag needs to know how many records were found in order to produce the
following....

1-10  |  11-20 |  21-30..... etc...

So how do I get the value in my custom tag?

I've tried the following...

<pager:pager currentPage="2" pageSize="10" totalResults="<%=(Integer)
request.getAttribute("NUMBER_FOUND")%>" url="participantSearch.do">

..but that doesn't work. What works? Or am I approaching this entirely
wrong?

Preston



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

Reply via email to