<%@ page language="java" errorPage="error.jsp" import="java.util.Vector" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/jwcache.tld" prefix="ojsp" %>
<title>listitem.jsp</title>
<%
   String itemid=request.getParameter("itemid");
   if (itemid==null) {
     out.println("Please select a category from the above drop down box.");
     return;
   }
%>
<% long l1=(new java.util.Date()).getTime(); %>
<ojsp:cache autoType="URI_selectedParam" selectedParam="itemid" 
  printCacheBlockInfo="true" printCachePolicy="true"
  policy="/WEB-INF/test-policy.cpd"
  >
Item List: <b><%= itemid %></b><br>
Time: <%= new java.util.Date() %>
<br>
<jsp:useBean class="java.util.Hashtable" id="table2" scope="application" />
<hr>
<%
  Vector list=(Vector) table2.get(itemid);
  if (list==null) {
    out.println("No such item!");
  }
  else {
    for (int i=0; i<list.size(); i++) {
%>
<%= list.elementAt(i) %><br>
<%    
    }
  }
%>
timestamp:<%= new java.util.Date() %>
<br>
</ojsp:cache>
<% long l2=(new java.util.Date()).getTime(); %>
Time for general cache operation:<%= l2-l1 %>
<br>

