JSF Central - FAQ
JSF Central

 
 Home 
 
 Products 
 
 Articles & Books 
 
 Resources 
FAQ > Programming with JSF
Can I reference indexed JavaBeans properties?
Updated: July 1, 2003

UI components in JSF can be associated with JavaBeans through value reference expressions. These expressions are a subset of the JSTL 1.0 / JSP 2.0 expression language (EL). Unfortunately, the EL doesn't currently support indexed properties. A workaround is to return a collection of objects:

public class RandomBean
{
   public Item[] getItems() { ... }
   public void setItem(int n, Item item) { ... }
}
This allows you to access the property items with the value reference "randomBean.items[0]".


RSS feed(all feeds)
RSS feed(Programming with JSF)

The Editor's Desk
Podcasts
Inside Facelets
In the Trenches

Site version 1.83  Report web site problems

Copyright (C) 2003-2015 Virtua, Inc. All Rights Reserved. Java, JavaServer Faces, and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. in the United States and other countries. Virtua, Inc. is independent of Oracle Corporation. All other trademarks are the sole property of their respective owners.