I want to expire my page or logout form application when user click browser back button or refresh button in JSF application. I am currently using JSF 2.2 with primefaces 4.x
Asked
Active
Viewed 153 times
1
-
1can you explain more? and i guess you need to change the scope of the bean you are using, to a flow, view or maybe request scope – Ouerghi Yassine Jul 23 '15 at 18:28
-
I am using view scope in whole application and using full ajax.I use p:button for going back to particular page.But requirement is that users are not expected to click browser back button.If user click browse back button the there should be exception or document expiration or even I want to logout from the session if possible – send2ashok Jul 23 '15 at 18:37
-
well if ur using "full ajax", then i guess you can detect if the user has navigated back to a specific address, you can play aroud with this jQuery plugin http://www.asual.com/jquery/address/ – Ouerghi Yassine Jul 23 '15 at 18:47
-
@Ouerghi Yassine thanks . If you can help me to get this solution also from JSF side then it will add sugar in honey :) – send2ashok Jul 23 '15 at 18:58
-
You mean like from the backing bean? well i would make like a sessionScoped bean, store the name of the page each the user change it, and like redirect him or invalidate his session (i dont know how you re storing the session) each time he violates ur page flow – Ouerghi Yassine Jul 23 '15 at 19:05