I have a simple introduction to the step of using the Pager Tag Library to implement paging function: 1: In the application server, you apply to the in Web-INF / Web.xml in the project ... Add: http://jsptags.com/tags/navigation/pager // You can change taglib-uri> / web-inf / jsp //pager-taglib.tld // Indicate Pager-Taglib.TLD location taglib-location> taglib> 2: to http://jsptags.com/tags/navigation/pager/ Download Pager-taglib-2.0 .war package, after decompression, you can get Pager-taglib.jar, put it under the web-inf / lib / packet. Pager-taglib.tld can go to / webinf / jsp / packet. 3: Add: <% @ Taglib Uri = "http://jsptags.com/tags/navigation/pager" prefix = "pg"%> 4: <% TotalItems = list.size ); // Received list string style = "simple" SING POSION = "Both"; // Top bottom int maxPageItems = 1; / / The number of data for each page Display data INT MAXINDEXPAGES = 4; // Display jump page The number string index = "center";%>
Export = "offset, currentpagenumber = Pagenumber" scope = "request"> <% - WARN IF offset is not a multiple of maxpageitems -%> <% if (Offset.intValue ()% maxpageitems! = 0 && ("alltheweb" .Equals (style) || "lycos" .Equals (style))) {% >