Java Reference
In-Depth Information
and is shown in Listing 3-58. This JSP retrieves the list of active products from the servlet
context and displays them.
Listing 3-58. ProductLoV.jsp
<%@ taglib prefix="c" uri="" %>
<%@ taglib prefix="fmt" uri="" %>
<title>LoV - Product</title>
<td>Product Id</td>
<td>Product Name</td>
<c:forEach var="productDtl" items="${applicationScope.productDtlList}" >
<td><c:out value="${productDtl.productId}"/></td>
<td><c:out value="${productDtl.productName}"/></td>
As shown in Listing 3-58, we are using a JSTL-based view helper to retrieve and
present the data stored in application scope. applicationScope is an implicit object avail-
able with the JSTL Expression Language, and it gives a handle to the servlet context. In
Listing 3-58, it looks for an attribute with the key productDtlList in the servlet context.
To use this semistatic view, you need to slightly alter the configuration, as shown in
Listing 3-59. Note that the SimpleUrlHandlerMapping has been configured to handle
UrlFilenameViewController .
Search WWH ::

Custom Search