Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Pagination?

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use DisplayTag.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

For your refe :- http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This same code i may applying in strut2.Its not working.

here is my jsp page code.


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that a question?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where do you define the scriptlet variable "pageUrl"?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i used <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>.





 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That defines the tag library.

Does the tag library expose a scripting variable "pageUrl"? Is the link rendering correctly?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

yes the tag library expose a scripting variable "pageUrl"

I got this from here.
http://jsptags.com/index.jsp
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! 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