Author
Pagination?
Rachel Kumar
Ranch Hand
Joined: Oct 21, 2008
Posts: 51
how do i implement this below view to navigate between pages. i mean what do i start off with? is it not pagination? where can i get more examples on this? -------------------------------- Issue 1 of 13 issue(s) << Previous | No:439 | Next >> -------------------------------- Thanks in Advance.
Jesus Angeles
Ranch Hand
Joined: Feb 26, 2005
Posts: 2036
Use DisplayTag.
Nishan Patel
Ranch Hand
Joined: Sep 07, 2008
Posts: 676
Hi, For your refe :- http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer ,My Blog
Siva gurun
Greenhorn
Joined: Dec 15, 2008
Posts: 19
Hi, Try this code: <body> <pg ager url="<%= (String )request.getSession().getAttribute("sessionValue")%>" maxIndexPages="21" export="currentPageNumber=pageNumber" maxPageItems="11" index="center"> <pg aram name="pg"/> <pg aram name="q"/> . . . <logic:iterate id="params" name="showMsg" indexId="count"> <pg:item> . . //Items to be paginate . . </pg:item> </logic:iterate> <pg:index> <font class="txtS" color="#646D7E"> <pg:first> <a href="<%= pageUrl %>"> [<b><<</b> First] </pg:first> <pg rev> <a href="<%= pageUrl %>">[<b><<</b> Prev]</a></pg rev> <pg ages><% if (pageNumber.intValue() < 10) { %> <% } if (pageNumber == currentPageNumber) { %><b><%= pageNumber %></b><% } else { %><a href="<%= pageUrl %>"><%= pageNumber %></a><% } %> </pg ages> <pg:next> <a href="<%= pageUrl %>">[Next <b>>></b>]</a></pg:next> <pg:last> <a href="<%= pageUrl %>"> [Last <b>>></b>]</pg:last> <br> </font> </pg:index> </pg ager> </body>
pankaj semwal
Ranch Hand
Joined: Oct 07, 2008
Posts: 300
This same code i may applying in strut2.Its not working.
here is my jsp page code.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Mar 31, 2009 06:01:09
0
Is that a question?
pankaj semwal
Ranch Hand
Joined: Oct 07, 2008
Posts: 300
Hi,
I mean when i try to use pager-taglib2.0 for pagination with strut2.Its not working while indexing.
as its opening blank page when i clicks on next link.
Thanks
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Mar 31, 2009 06:14:03
0
Where do you define the scriptlet variable "pageUrl"?
pankaj semwal
Ranch Hand
Joined: Oct 07, 2008
Posts: 300
Hi,
i used <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Mar 31, 2009 06:24:01
0
That defines the tag library.
Does the tag library expose a scripting variable "pageUrl"? Is the link rendering correctly?
pankaj semwal
Ranch Hand
Joined: Oct 07, 2008
Posts: 300
Hi,
yes the tag library expose a scripting variable "pageUrl"
I got this from here.
http://jsptags.com/index.jsp
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Mar 31, 2009 06:34:44
0
Wow, haven't seen that site in awhile. Looks like the last update was ~6 years ago.
I'd sure consider using DisplayTag, since it's somewhat more up-to-date. Otherwise your best bet is to try to find support for the Pager tag library; not sure how to do that.
I don't see in your code where you set the url for the pager, however, so I'm not sure how to help.
subject: Pagination?