GeeCON Prague 2014*
The moose likes JSP and the fly likes How to get displayed records on current page into separate List? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "How to get displayed records on current page into separate List?" Watch "How to get displayed records on current page into separate List?" New topic
Author

How to get displayed records on current page into separate List?

uday batta
Greenhorn

Joined: Apr 22, 2009
Posts: 8
How to get displayed records on current page into separate List??

I have displayed 100 records using display tags library. i have format like <First/Prev>1 2 3....<Next/Last>

so when i click on 2, i will get certain records per page and i want to store/fetch/pull those records into separate List..

looking forward

thanks
uday
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


hi,

If you are using display tag then you can not get list while you are going from 1 to 2 page or any other.

Because display tag was made using custom tag. So, they have their mechanism to get result to another page and iterate your list.

So, on click their pagination link you can not get result i think.

But i might be wrong.



Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
uday batta
Greenhorn

Joined: Apr 22, 2009
Posts: 8
is there any possibility to get and/or put those records in a session object..?

all i want to do is get the currently displayed records on a certain page into separate List/Object and i can use those records for further use...

is there any alternative way to achieve???
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


hi,

I think yes,

at the time your display tag iteration add every element in one session oblect.

Create one list which contains id of your displayed record.

At the time of you use <display:column add id to created list and at last just add this list to session.

That's way you can get id of your list and then if you want record you have to get it again form database.

>
uday batta
Greenhorn

Joined: Apr 22, 2009
Posts: 8
hi,

can you suggest me the code and where to place the code

looking forward.

thanks
uday
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61298
    
  66

Have you checked the JSP FAQ entry on this very subject?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: How to get displayed records on current page into separate List?