Use the Pager Tag Library to achieve paging function

xiaoxiao2021-03-06  114

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 ... http://jsptags.com/tags/navigation/pager // You can change / web-inf / jsp //pager-taglib.tld // Indicate Pager-Taglib.TLD location 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))) {% >

warning: The current page offset is not a multiple of max. Page Items.
Please <%}%> <% for (int I = 0; i

<% = list.get (i)%> // Simple display data;


New Post(0)