Database Reference
In-Depth Information
<%- - null or empty value test -- %>
<c:when test= "${empty email}" >
<c:out value= "${name}" />
</c:when>
<c:otherwise>
<a href= "mailto:<c:out value=" ${email}" /> ">
<c:out value= "${name}" /></a>
</c:otherwise>
</c:choose>
</li>
</c:forEach>
</ul>
19.5. Creating Navigation Indexes from Database Content
Problem
A list of items in a web page is long. You want to make it easier for users to move around
in the list.
Solution
Create a navigation index containing links to different sections of the list.
Discussion
It's easy to display a list in a web page (see Recipe 19.2 ), but if the list contains a lot of
items, the page becomes quite long. It's often useful to break a lengthy list into sections
and provide a navigation index in the form of hyperlinks that enable users to reach
sections of the list directly without scrolling the page. For example, if you retrieve rows
from a table and display them grouped into sections, you can include an index that lets
the user jump to any section. The same idea applies to multiple-page displays as well,
using a navigation index in each page that enables users to reach any other page easily.
This recipe provides examples to illustrate both techniques, using the kjv table intro‐
duced in Recipe 5.12 :
• A single-page display that lists all verses in all chapters of the book of Esther. The
list is broken into 10 sections (one per chapter), with a navigation index that has
links pointing to the beginning of each section.
• A multiple-page display consisting of pages that each show the verses from a single
chapter of Esther, and a list of links to pages for each of the other chapters. These
links enable any page to be reached easily from any other.
Search WWH ::




Custom Search