I have a ObjectLIstDataProvider (i.e. oldp) stored in session in order to support sorting functions. It works fine.
However, when a user leavs the page where a table uses this oldp and browses some other pages, then comes back to this page, the data will still be shown for this user since oldp is stored in session (i.e. SessionBean1.java).
Here is my question: Is there any way knowing a user is browsing away from the page with oldp so i could clean the oldp in session? Where should i put this code for cleaning?
I did not find a way to distinguish when a page is rendering due to button action/sorting action/Dropdown list change (in those case, you should keep the oldp in session), and when a user is coming to this page from another page (In this case you DO need to clean oldp in sesion)?
I guess i could record last rendered page in session in order to distinguish where a user is from (same page or another page). However, I would like a more descent way to do it.