freemarker标记实现翻页

来源:互联网 发布:jsp引入js文件 编辑:程序博客网 时间:2024/05/16 12:05

[#--  countPage:总页数, startPageNo:上次访问的页码数 --]

[#if countPage==0]    

[#else]
    Page:
    <a href="/customer/ReadPageNoMessage.html?pageNo=1">1</a>&hellip;
  
   [#if startPageNo < 5]


   [#list (startPageNo)..(startPageNo+8) as i]
   [#if (countPage>=i)]
       [#if 1==i]
       
       [#else]
             <a href="/customer/ReadPageNoMessage.html?pageNo=${i}">${i}</a> 
       [/#if]  
   [/#if]
   [/#list]
 
   [#else]
  
   [#list (startPageNo-4)..(startPageNo+4) as i]
            [#if 1==i]
            
            [#else]
                 [#if (countPage>i)]
                <a href="/customer/ReadPageNoMessage.html?pageNo=${i}">${i}</a>   
            [/#if]
      
       [/#if]  
   [/#list]
 
   [/#if]
   &hellip;
   <a href="/customer/ReadPageNoMessage.html?pageNo=${countPage}">${countPage}</a>
[/#if] 
0 0
原创粉丝点击