• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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.
 
This is my favorite show. And this is my favorite tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic