The term collection has a slightly different meaning in JSTL than it does in Java. In JSTL many different types of objects can function as a collection. In particular, the following types of classes often form collections in JSTL: -
Any class that implements the java.util.Collection interface -
Arrays of objects or primitive data types -
Any class that implements the java.util.Iterator interface -
Any class that implements the java.util.Enumeration interface -
Any class that implements the java.util.Map interface -
Comma-delineated strings (java.lang.String) All classes that are members of the Java collections API can be used with the JSTL iteration tags. These include LinkedList, ArrayList, Vector, Stack, Set, and Map. Additionally, string items that contain comma-delineated text can be used. Data is often collected using these collection types, and understanding how to access collections using JSTL is important. One particularly handy feature of JSTL collections is that a comma-delimited string can be iterated over. For example, the list of values Monday, Tuesday, Wednesday, Thursday, Friday could be iterated over to return each day individually. Now, let's look at the JSTL tags that are used with JSTL collections. |