The following example renders a list of the page numbers of all pages of results. Each page number is a link to the corresponding results page, except for the current page number, which is displayed without a link. For example, if pagesAvailable is 43 and the current page is page 10, this code will render the integers from 1 to 43, and all of these except 10 will be links. If the user clicks 22, for example, a request to display page 22 will be issued.

<!-- Indicate that the request should be saved in the search
     session so that initial request data, such as the question
     text, is available to subseqent paged requests. -->
<dsp:input bean="QueryFormHandler.searchRequest.saveRequest"
           value="true" type="hidden"/>

<!-- Display page numbers with links to take user to specified
     page -->
Go to Page:
<c:forEach var="page" begin="1" end="${formHandler.pagesAvailable}">
  <c:choose>
    <c:when test="${page == (1+formHandler.searchResponse.pageNum)}">
      ${page} <!-- The current page, don't display a link -->
    </c:when>
    <c:otherwise>
      <dsp:a href="normal-paging.jsp">
        ${page}
        <dsp:property bean="QueryFormHandler.searchRequest.requestChainToken"
                      value="${formHandler.searchResponse.requestChainToken}"/>
        <dsp:property bean="QueryFormHandler.searchRequest.saveRequest"
                      value="true"/>
        <dsp:property bean="QueryFormHandler.goToPage" value="${page}"/>
      </dsp:a>
    </c:otherwise>
  </c:choose>
</c:forEach>