cancel
Showing results for 
Search instead for 
Did you mean: 

how to do paging in a jsp and how to load data to specific pages

Former Member
0 Kudos

I want to show 10 rows of data in a one page and remain in other pages. How to do it and let me know how to use tags inside display:table.Because I'm using a display:table tag to show data. Also I have already add requestURI attribute and map it inside struts-config.xml file with the neede .jsp to be loaded. But it didnt work as I want. Please help me.

Reguards..

Dileka..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

there of couple of tag libraries available using which you can implement paging

see links below

http://jsptags.com/tags/navigation/pager/pager-taglib-2.0.html

http://www.servletsuite.com/servlets/pagertag.htm

Former Member
0 Kudos

Thanx Amol, I went to those links and they were helped me alot.But the fact is sinse I'm getting data from a database and showing them using display:table tag I cannot understand where to put those offset like tags. Also I dont have the neccesary .tld. I will add here my code inside jsp file.Im working on struts framework and my ide is myeclipse.

<display:table border = "0" width="100%" scope="session"  pagesize="15" offset="15" 
name="recievedReportQueues" styleClass="table_report" requestURI="receivingSmsReportPaging.do">
<display:column  property="id" title="Id"  align="center" 
href="recSMSValueShow.do?showRec=showRecievedDetails" 
paramId="recievedSMSValueSid" paramProperty="id"  
sort="true" width="10%"/>   
<display:column property="module" title="Module" width="10%" 
align="center" sort="list"/> 
<display:column property="modifiedDateOnly" 
title="Updated Date" width="10%" align="left" sort="list"
 maxLength="15" />                   
 <display:column property="modifiedTimeOnly" title="Updated Time" 
width="20%" align="left" sort="list" maxLength="15" />  
<display:setProperty name="sort.behavior" value="list" />
<display:setProperty name="paging.banner.include_first_last"
 value="true" />
 <display:setProperty name="table_report" value="true" />
  </display:table>

recievedReportQueues is the list of objects I'm getting from the session and its set inside the action class.

Please help me with a sample code.Im really in a hurry to do this.

Thanx..

Answers (0)