I use JSF 2.2 & prettyfaces. I want to prevent security problems linked to browser backward functionality.
To resume the navigation link between my pages in my application : I have a login page done with Spring Security which redirects after connexion to a HomePage. The HomePage is in ViewScoped. From this HomePage , i can go to a AddPatientPage in ViewScoped and a AddAnalysePage in SessionScoped.
When the user is on the AddP*Page, if he clicks the browser backward button, i don't want to use cached page. I want a kind of redirection/ refresh of the page. I want the Homepage to use the initial values as it was a first load.
I'm trying to apply this solution without success... For example, when i get back to the HomePage from Add*Page, the values from the SelectOneMenu are not the initial ones, but the last selectioned. So i believe the cash is still use... Before to test , i cleared the cache files from browser.
Thanks for the help.
As BalusC in previous Post, i don't use annotation but directly referencing the filter in web.xml as above.
<filter>
<filter-name>noCacheFilter</filter-name>
<filter-class>com.clb.genomic.lyon.servletFilter.NoCacheFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>noCacheFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
* EDIT :*
Using different words ,the problem is that when i use the backward button the values of the page components are not the same that its backing bean. So i don't understand which are kept tracked and which ones are not in the scope.
* EDIT2 :*
Ok , i let down the ajax call. The idea of the ajax call was that when you select a value in SelectOneMenu from a first form , you then inject the result to and other form with a second another SelectOneMenu and a commandButton to send all the values together. That was a mess to handle with backward button compatibility. So now i put the two selectOneMenu, in an unique form without ajax and it's working well...no problem with backward button and synchronisation between beans & page values of SelectOneMenu...
I hope someone have understand what was i trying to do :)