Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF 2 : How to make browser back button not to used cache pages and make a kind of refresh/redirection?
    text
    copied!<p>I use JSF 2.2 &amp; prettyfaces. I want to prevent security problems linked to browser backward functionality.</p> <p>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.</p> <p>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.</p> <p>I'm trying to apply this <a href="https://stackoverflow.com/questions/10305718/avoid-back-button-on-jsf-web-application?lq=1">solution</a> 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.</p> <p>Thanks for the help.</p> <p>As BalusC in previous Post, i don't use annotation but directly referencing the filter in web.xml as above.</p> <pre><code>&lt;filter&gt; &lt;filter-name&gt;noCacheFilter&lt;/filter-name&gt; &lt;filter-class&gt;com.clb.genomic.lyon.servletFilter.NoCacheFilter&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;noCacheFilter&lt;/filter-name&gt; &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt; &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt; &lt;/filter-mapping&gt; </code></pre> <p><strong>* EDIT :*</strong> </p> <p>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.</p> <p><strong>* EDIT2 :*</strong> </p> <p>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 &amp; page values of SelectOneMenu...</p> <p>I hope someone have understand what was i trying to do :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload