Skip to Main Content
Mastering JavaServer Faces 2.2
book

Mastering JavaServer Faces 2.2

by Anghel Leonard
June 2014
Intermediate to advanced content levelIntermediate to advanced
578 pages
12h 2m
English
Packt Publishing
Content preview from Mastering JavaServer Faces 2.2

The CollectionDataModel class of JSF 2.2

Until JSF 2.2, the supported types for the <h:dataTable> tag contains java.util.List, arrays, java.sql.ResultSet, javax.servlet.jsp.jstl.sql.Result, javax.faces.model.DataModel, null (or empty list), and types used as scalar values.

Note

Starting with JSF 2.2, we can also use java.util.Collection. This is especially useful to Hibernate/JPA users, who are usually using the Set collections for entity relationships. Therefore, nothing can stop us from using a HashSet, TreeSet, or LinkedHashSet set for feeding our JSF tables.

The next example is like a test case for the most-used Java collections. First, let's declare some collections of Players as follows:

  • java.util.ArrayList: This library implements java.util.Collection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaServer Faces

JavaServer Faces

Hans Bergsten

Publisher Resources

ISBN: 9781782176466Supplemental Content