Problema com Paginação com JSTL

0 respostas
J

Boa noite a todos, estou estudando paginação com jstl e tenho um problema para mostrar a paginação da páginas (1…2), bem como o próximo ou anterior, consigo mostar a quantidade de registro que quero, mas não com paginação, segue abaixo o código para análise:

<pg:pager   
        items="${tamanho}"   
        index="center"  
        maxPageItems="05"  
        maxIndexPages="6"  
          
        export="offset,currentPageNumber=pageNumber"  
        scope="request">  
	
	<c:forEach var="paises" items="${listPaises}">

		<pg:item>  
    	<tr>
    	  	
    	  	<c:if test="${paises.AC01A_CODPAIS % 2 == 0 }">
	      		<td bgcolor="blue" width="28%">${paises.AC01A_CODPAIS}</td>  
    	  		<td bgcolor="blue" width="72%">${paises.AC01A_NOMEPAIS}</td>
    	  	</c:if>
    	  	<c:if test="${paises.AC01A_CODPAIS % 2 == 1 }">
	      		<td bgcolor="yellow" width="28%">${paises.AC01A_CODPAIS}</td>  
    	  		<td bgcolor="yellow" width="72%">${paises.AC01A_NOMEPAIS}</td>
    	  	</c:if>	
    	  		
		</tr>
		</pg:item>
			<jsp:include page="/WEB-INF/geral/menu.jsp" flush="true" /> 
		<pg:index>
		</pg:index>
		
	</c:forEach>
	
	</pg:pager>

Se eu não colocar a linha do include que importa o menu.jsp um jsp, aparece uma lista de ocorrências conforme a quantidade que limitei (5 por páginas), o problema é que não existe uma paginação, e se eu declaro o “menu.jsp” o meu código não funciona. Segue abaixo o jsp “menu.jsp” que estou com problema:

Não consigo entender quais valores tenho que preencher nestas variáveis:

pageUrl - Devo declarar? Pois no exemplo que pesquisei não encontrei nenhuma informação sobre esta variável.
currentPageNumber - ?
pageNumber - ?

<%@ page session="false" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<jsp:useBean id="currentPageNumber" type="java.lang.Integer" scope="request"/>
<i>This index references <font
color="#0000cc">G</font><font color="#cccc00">oo</font><font
color="#0000cc">g</font><font color="#00cc00">l</font><font
color="#cc0000">e</font>.com for images.<br>
If you're not currently connected to the Internet you will see broken images.</i><br>
&nbsp;<br>

<table border=0 cellpadding=0 width=10% cellspacing=0>
<tr align=center valign=top>
<td valign=bottom><font face=arial,sans-serif
  size=-1>Result&nbsp;Page:&nbsp;</font></td>
  
<pg:prev export="pageUrl" ifnull="<%= true %>">
  <% if (pageUrl != null) { %>
    <td align=right><A HREF="<%= pageUrl %>"><IMG
      SRC="img/nav_previous.gif" alt="" border=0><br>
    <b>Previous</b></A></td>
  <% } else { %>
    <td><IMG SRC="img/nav_first.gif" alt="" border=0></td>
  <% } %>
</pg:prev>

<pg:pages>
  <% if (pageNumber == currentPageNumber) { %>
    <td><IMG SRC="img/nav_current.gif" alt=""><br>
    <font color=#A90A08><%= pageNumber %></font></td>
  <% } else { %>
    <td><A HREF="<%= pageUrl %>"><IMG
      SRC="img//nav_page.gif" alt="" border=0><br>
    <%= pageNumber %></A></td>
  <% } %>
</pg:pages>

<pg:next export="pageUrl" ifnull="<%= true %>">
  <% if (pageUrl != null) { %>
    <td><A HREF="<%= pageUrl %>"><IMG
      SRC="img/nav_next.gif" alt="" border=0><br>
    <b>Next</b></A></td>
  <% } else { %>
    <td><IMG SRC="img/nav_last.gif" alt="" border=0></td>
  <% } %>
</pg:next>

</tr>
</table>
Criado 28 de outubro de 2011
Respostas 0
Participantes 1