• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Pagination

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I want to do pagination using jsp & struts. Im using my own taglib which is like

<inte ageindex
pageIndex='<%=new PageIndex(startIndex,records_per_page,total_records) %>'
url='<%="A.do?event=list&startIndex="%>'
submitFlag='<%=new Boolean(false)%>
</inte>


I have to get the values from the external file which is in *.csv format.

From class file,im storing all values in Collection and passing to JSP page.

In Jsp page
-----------
<%
Collection OBList = (Collection)request.getAttribute("request.OBAList");
int startIndex = 0;
if (OBList != null && OBList.size() > 0) {
pageContext.setAttribute("OBList",OBList);

}


%>

Using the OBList collection able to load all the records to the Jsp page and its working fine but here the problem is i have to disply it according to the pagination link.

the sample link looks like ===> pg 1 2 3 Next

If i use this PageIndex(0,5,15) the URL is
After click the number 2 the URL
The URL:http://localhost:7080/training/A.do?event=list&startIndex=5


Thanks in Advance.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic