Hello, how are you?
Today we will do JSF datatable pagination with a Lazy List with a view scoped managed bean. What all those words/expressions mean?
Usually the datatables will put the displayed List, with the entities, inside the user http session. Increasing the objects inside the user session will have a direct impact on the server performance; each user that displays a datatable, that keeps a list in the session, will be allocating more and more memory in the server.
To look like real life, our post will use JPA and HSQLDB as database, and we will use JPQL to query the data.
In the end of this post you will find the link to download the source code.
We will use:
- JSF 2.0 – JBoss 7 Implementation
- JBoss 7.1 – the code of this post should be applied to all servers
- Eclipse Indigo
- JPA 2.0 – JBoss 7 Implementation
- HSQLDB (2.2.8) – The HSQL it is a memory database, it will be easier to run it.
- Primefaces 3.2
This post is not about good development practices nor about adding classes layers of project modeling. I just intend to show how to do a pagination without a session managed bean.