Gotag Simple Paging label

Source: Internet
Author: User
Tags prev

Gotag Readme

Forced to do pagination on the Web page recordset, I realized this label for pagination, sharing with you.

This is a simple page tab for Web pages. This tab allows you to page through the incoming recordset, and you can control the number of records displayed per page by setting the parameters. User interface is also relatively simple and practical, provide the first page, last, Prev, next page and direct jump way to specify the page to display the recordset you need.

How to use:

Put the Go-1.0.jar in your Web-inf/lib directory.

Introducing labels on a page

JSP code

<%@ taglib prefix= "Go" uri= "Http://www.zlex.org/tag/go"%>

You can refer to the following code for use:

JSP code

<% list<string> List = new arraylist<string> ();
for (int i = 1; I <= i++) {List.add (string.valueof (i));} request.setattribute ("list", list); %> <c:set var= "Gourl" value= "go.jsp?method=list" scope= "request"/> <c:choose> <c:when test= "${empty Param.pageno} "> <c:set var=" PageNo "value=" 1 "scope=" request "/> </c:when> <c:otherwise> <c: Set var= "PageNo" value= "${param.pageno}" scope= "Request"/> </c:otherwise> </c:choose> <go:go url= "$ {Gourl} "pageno=" ${pageno} "Pagenoname=" ${pageno} "source=" ${list} "Pagelistname=" ${pagelist} "pageSize=" 5 "> < div> <br/> <c:foreach items= "${pagelist}" var= "L" > <c:out value= "${l}"/> <br/> </c:forE ach> <br/> </div> <span> <go:pageno/> page, total <go:pagecount/> page </span> <span >[<a href= "<go:first/>" > Home </a>]</span> <span>[<a href= "<go:last/>" > Last </a>]</span> <span>[<a href= "<go:previous/>" > Prev </a>]</span> <span>[<a href= "<go:next/>" > Next </a>]</span> <span> jump to page <go:select/> page </span> </go: Go>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.