How to initialize List property in Managed Mean?

List property in Managed Mean

JSF Managed Beans can initialize its List properties in the faces-config.xml. There is a property in the faces-config.xml as list-entries. This cane be used for initializing the values and can be accessed directly through the Managed Beans in any JSP pages.

also read:

You also can directly use the List as Managed Beans.

JSP File (index.jsp)

<%@taglib prefix="f" uri=""%>;
<%@taglib prefix="h" uri=""%>
                <h:dataTable var="loc" value="#{jsfBean.listValues}">
                        <h:outputText value="#{loc}"/>

JavaBean (


import java.util.List;

 * source :
public class JavaBeatJsfBean {

    private List listValues;

    public List getListValues() {
        return listValues;

    public void setListValues(List listValues) {
        this.listValues = listValues;


<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="1.2"



About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.