Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

pagination for ArrayList  RSS feed

 
Jiya Khan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have ArrayList of valueobject Things and need to display the details things name things price etc.. in some table structure..


can any one guide me how to achieve pagiantion for ArrayList?
code is as follows
<% List defaultlist= new ArrayList();
if(request.getAttribute("DefaultThings")!= null) {
defaultlist = (List)request.getAttribute("DefaultThings");
}

ListIterator iter1 = defaultlist.listIterator();
String name= new String();
int coun1t=0;
while (iter1.hasNext()) {
Things th1= (Things)iter1.next();
name= th1.getThingsName();
%>

<table><tr><td>
<%=name%>

</td></tr></table>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's okay, I didn't need to read that code anyway. Just the word "pagination" in the JSP forum says that you should follow the link at the top of the JSP forum, the one linking to the JSP FAQ. Search that page for "pagination".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!