Note that there are some explanatory texts on larger screens.

plurals
  1. POjsf viewexpiredexception faces-redirect not working
    primarykey
    data
    text
    <p>I have a filter that if the session has expired and the method is POST, then adds the faces-redirect param to the url and makes the browswer not to cache the page, in order to avoid the viewExpiredException, but doesn't work, I still get that exception.</p> <p>Here's my code:</p> <pre><code> if ( "POST".equalsIgnoreCase(request.getMethod()) ) { log.info("POST --&gt; Evitar ViewExpiredException de JSF"); log.info("Hacer que el navegador no cachee la página"); response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. response.setHeader("Pragma", "no-cache"); // HTTP 1.0. response.setDateHeader("Expires", 0); // Proxies. log.info("Redirigir a la página con el parámetro 'faces-redirect'"); String pagRedirect = anadirFacesRedirect(pagSolicitada); log.info("Página con 'faces-redirect' = "+pagRedirect); log.info("URI con 'faces-redirect' = "+request.getContextPath()+pagRedirect); response.sendRedirect(request.getContextPath()+pagRedirect); chain.doFilter(request, response); return; } </code></pre> <p>The "anadirFacesRedirect" method adds "faces-redirect=true". It works ok, I've debugged and saw the logs and the sendRedirect param is ok.</p> <p>I put this code in a Spring Security filter.</p> <p>I don't know if that is the problem (beacuse of Spring Security), or is there something wrong in the code?</p> <p>Thank you.</p> <p><strong>UPDATE:</strong> I've already checked that it isn't a Spring Security issue, because I've put it in a webfilter that excutes after the filterchain of Spring Security, but it still doesn't work, it throws viewExpiredException.</p> <p>Why is this? I've forced a redirect and make the browser not to use the cache page.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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