title: Calling java class (managedBeans) functions in JSF files
body: <p>I have questions about working with managedBean and JSF files. I am a beginner in this concept, my apology if my question is very basic.
  Here is my main function in my managedBean java file.</p>
  
  <pre><code>ArrayList&lt;ArrayList&lt;Object&gt;&gt; processDataSources(String mainFile, String comparingFile, int mainFileNumOfColumn, int comaringFileNumOfColumn), 
  </code></pre>
  
  <p>In brief what this function does is that it read a certain number of columns of two Excel file line by line and cleans its data by removing duplicates and returns one collection of clean data per file, then compares each record in collection one with each record in collection two. </p>
  
  <p>Then it preserves the common terms of each two records. Eventually, this function returns a collection that each record in this collection is an array of objects. These objects id1,id2, number of matching term, a collection of matching words, a collection of original words of list1, and a collection of original words of list2. </p>
  
  <pre><code>ArrayList&lt;ArrayList&lt;Object&gt;&gt; processDataSources(String mainFile, String comparingFile, int mainFileNumOfColumn, int comaringFileNumOfColumn)
  </code></pre>
  
  <p>My goal is to have two buttons to browse for Excel file and one button to start the process. Once Process button is pressed, the path value of the location of excel files are passed to the <code>processDataSources()</code> function and the result of the process is being displayed on the screen. I have some ambiguity on how to write code for it in my JSF files. I really appreciate if someone gives me some hints on that. </p>
  
  <p>Now in my XHTML file, I don't now know how to get a hold of the collection returned by <code>processDataSources</code> function.  </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang = "eng"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
        xmlns:p="http://primefaces.org/ui"&gt;
  
        &lt;h:head&gt;          
          &lt;title&gt;Excel file process&lt;/title&gt;
        &lt;/h:head&gt;
        &lt;h:body&gt;
          &lt;h:form&gt;
  
           //here I intend to put two browse button to browse into my computer and get a hold of 2 excel file 
              &lt;h:commandButton value="process" action=""/&gt; 
         // when Process button is pressed, I would like to save the address of the // 
        //two selected excel file and pass them to precessDataSource called below.
  
          &lt;/h:form&gt;
          &lt;h:dataTable value=#{procesDataSource(mainFile, comparingFile, mainFileNumOfColumn, comaringFileNumOfColumn) var="currentRecord"}
            &lt;h:column&gt;
                &lt;f:facet name="header"&gt;Main List ID&lt;/f:facet&gt;
                  #{currentRecord.get(0)}//is this right way of getting the value in the first bucket is correct. or do I have to create an object and store the value as the property of this object instead preserving it in an array?
                 &lt;f:facet name="header"&gt;Number of matching&lt;/f:facet&gt;
                  #{currentRecord.get(1)}
            &lt;/h:column&gt;
      &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>