title: Efficient JSF Pagination
body: <p>Whats the most efficient way of doing pagination in JSF 2.0 app?
  I use Primefaces datatable and it is intelligent enough to perform
  pagination by itself with no coding at all.</p>
  
  <pre><code>&lt;p:dataTable var="car" value="#{carBean.cars}" paginator="true" rows="10"&gt;
      &lt;!-- Multiple columns here--&gt;
  &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>The thing that I see, is that I need to place my bean to session scoped or greater.</p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class CarBean{
      public List&lt;Car&gt; getCars(){
          //return data from DB
      }
  }
  </code></pre>
  
  <p>I wanted to know is there another efficient way on how to perform this?</p>
  
  <p>I used EJB/JPA at the backend by the way.  Would like to know any links or tutorials
  to learn more about this.</p>
  
  <p>Thanks.</p>