<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <div id="page"> <% String p_head = "|<<先頭ページへ"; String p_prev = "<前へ"; String p_next = "次へ>"; String p_tail = "末尾ページへ>>|"; int wsiz = 10; int w1 = 5; int w2 = 5; int pcnt = (int)(found / rows + ( ( found % rows ) == 0 ? 0 : 1 )); int cpag = (int)(start / rows + 1); int wbgn = cpag - w1; int wend = cpag + w2; if( wbgn < 1 ){ wbgn = 1; wend = wbgn + wsiz; if( wend > pcnt + 1 ){ wend = pcnt + 1; } } if( wend > pcnt + 1 ){ wend = pcnt + 1; wbgn = wend - wsiz; if( wbgn < 1 ){ wbgn = 1; } } %> <% if( pcnt > 1 ){ %> <strong>Page</strong> <% if( cpag > 1 ){ %> <a href="./index.html<%=SearchUtil.getLinkStr(query,fq, null, 0)%>"><%=p_head%></a> <a href="./index.html<%=SearchUtil.getLinkStr(query,fq, null, ((cpag-2)*rows))%>"><%=p_prev%></a> <% } %> <% for(int i=wbgn;i<wend;i++){ %> <% if(cpag == i){ %> <%=i %> <% }else{ %> <a href="./index.html<%=SearchUtil.getLinkStr(query,fq, null, ((i-1)*rows))%>"><%=i %></a> <% } %> <% } %> <% if( cpag < pcnt ){ %> <a href="./index.html<%=SearchUtil.getLinkStr(query,fq, null, (cpag*rows))%>"><%=p_next%></a> <a href="./index.html<%=SearchUtil.getLinkStr(query,fq, null, ((pcnt-1)*rows))%>"><%=p_tail%></a> <% } %> <% } %> </div>