<%@ taglib uri="/ixtaglib" prefix="jsptut" %>
<%@ page import="java.util.*" %>

<html>
	<head>
		<title>Loop TagLibrary example</title>
	</head>
	
	<body>	
	 <UL>
   <LI><I>ForEach with Vector:</I><br>
   <% Vector theVector = new Vector() ;
      theVector.addElement("Hello" );
      theVector.addElement("World" );
   %>
   <jsptut:foreach item="element"  list="<%= theVector.elements() %>" >
   <%= element %>
   </jsptut:foreach> 

   <LI><I>ForEach with Hashtable:</I><br>
   <% Hashtable theHash = new Hashtable() ;
      theHash.put("k1","Hello" );
      theHash.put("k2","World" );
   %>
   <jsptut:foreach item="key"  list="<%= theHash.keys() %>" >

   Key: <%= key %> Value: <%= theHash.get(key) %><br>
   </jsptut:foreach> 

		<LI><I>Currency:</I><br>
   Format currency 9.3 = <jsptut:currency value="<%=9.3%>"/><br>
   Format currency 9.313 = <jsptut:currency value="9.313"/>
   <LI><I>ForEach with currency output:</I><br>
   <% Vector theVectorC = new Vector() ;
      theVectorC.addElement(new Double("21.34") );
      theVectorC.addElement(new Double("34.456") );
   %>
   <jsptut:foreach item="element"  list="<%= theVectorC.elements() %>" >
   <% boolean expr = ((Double)element).doubleValue()> 25.0 ;%>
   <jsptut:if expr="<%=expr%>" >
   <%=element%> format=<jsptut:currency value="<%=(Double)element%>"/><br>
   </jsptut:if>
   </jsptut:foreach>
		<LI><I>If true:</I><br>
   <jsptut:if expr="true">
     Hello here is the body
   </jsptut:if>
		<LI><I>If false:</I><br>
   <jsptut:if expr="false">
     When you this, the if Taglib implementation is wrong!
   </jsptut:if>
   <BR>After if-Tag --- Body write this out
   </UL>
   <br>
		End...
	</body>
</html>