problem displaying a list on a jsf table

Posted on 2007-08-02
Last Modified: 2013-11-23

I am using JSF as a controller for this application and am trying to display the contents of a list contained in a bean.
Here's an excerpt of my bean:
public class LogManageBean implements ValueChangeListener, ActionListener {
private List test;

public void SearchLog(){
// populates the test list
public List getTestList(){
return test;



In my faces config file I've declared the bean like this:


In my jsp page I want to display the contents of the list upon a button click.
      <h:commandButton value="Display" actionListener="#{viewLog.SearchLog}"  />
I don't know how can I display the contents of the list upon hitting the button. Basically how can I tie in the list to the <table> in jsp. The problem is that the button populates the list but how would the table know how to access the contents of the list.

Could someone please advise?

Question by:askhan1
    LVL 4

    Accepted Solution

    <h:dataTable value="#{logManageBean.test}"
        <h:outputText value="#{rowVar.col1Data}"/>
        <h:outputText value="#{rowVar.col2Data}"/>

    col1Data and col2Data is the property field name in your test object.

    You should write a getTest method, not getTestList, as the JSF would interpret the naming wrongly.


    LVL 26

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

    I will leave the following recommendation for this question in the Cleanup Zone:
    Accept doraemon-nolife comment as answer.

    Any objections should be posted here in the next 4 days. After that time, the question will be closed.

    mrcoffee365 Experts Exchange Cleanup Volunteer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    NotAlone Challenge 20 65
    maxMirror challenge 10 67
    Receive file in Servlet 1 25
    strDist challenge 35 69
    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now