0
votes

I am implementing server side pagination using Richfaces, but the implementation using PaginatingDataModel requires bean to be saved in SessionScope. Using JSF 2.0, RichFaces 4.4. Refer URL below:

http://katzmaier.blogspot.in/2010/03/richfaces-server-side-pagination.html https://community.jboss.org/thread/204250

Is there any alternate implementation to implement server side pagination using request scope? By server side pagination, I mean data for each page to be fetched by executing queries instead of retrieving all records at once.

1
Have you tried ViewScoped ? - Alexandre Lavoie
If you're using JSF 2 + RichFaces 4, then you can try using a @ViewScoped managed bean. If you're using JSF 1.2 + RichFaces 3.x, you can add the @KeepAlive annotation to your request scoped managed bean class in order to make it live while the user is still in the same view. - Luiggi Mendoza
@AlexandreLavoie that won't work if OP uses JSF 1.2 (by the question, it looks like OP's not using JSF 2). - Luiggi Mendoza
@LuiggiMendoza, yes, I was hoping the OP has upgraded since JSF 2.0 has major benefits :) - Alexandre Lavoie
@AlexandreLavoie not everyone can upgrade from JSF 1.2 to JSF 2.0 for different restrictions i.e. web application server is Java EE 5 compliant, and our answers should help OP with what he/she currently works. - Luiggi Mendoza

1 Answers

1
votes

As answered in comment, you could use the ViewScoped instead of SessionScoped. This is a new scope available since JSF 2.0, perfect to keep data server side for a shorter time.

Here is a link of a blog talking about new features in JSF 2.0 What's new in JSF 2.0