How to perform pagination in jsp

前端 未结 3 428
梦谈多话
梦谈多话 2021-01-22 01:39

i need pagination concept to display 15 records. this is my jsp file.

<%
ArrayList al = new ArrayList();
%>
<%!String s;
int i;%>
<         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-22 02:31

    The Display Tag library is an open source library which provides pagination functionality while still being easy to use.

    You can set your records in request scope from your servlet class.

    request.setAttribute( "test", new TestList(10, false) );
    

    and Then you can use display tag library to display it with pagination.

    <%@taglib uri="http://displaytag.sf.net" prefix="display" %>
    
    
    
      
      
      
      
      
    
    

    You can find it's basic tutorials here.


    Updated:

    You need not to use

    , ,
    tag only and is enough. You can directly use fields from EmpList inside property tag of .

    Follow this tutorial.

    提交回复
    热议问题