aspose file tools*
The moose likes Struts and the fly likes Pagination? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pagination?" Watch "Pagination?" New topic
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: 2057
Use DisplayTag.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 686

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

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

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

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

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pagination?