title: How to stop firefox asking to resend on data refresh?
body: <p>I have added a login to my JSF aplication and when I tested it in FireFox it keeps resend form data on refresh.<br>
  I have look through <a href="https://stackoverflow.com/questions/4327236/stop-browsers-asking-to-resend-form-data-on-refresh">this</a> question and links, but I didn't catch what is going on. </p>
  
  <p>Here is my code.</p>
  
  <pre><code>@Override
          public void doFilter(ServletRequest request, ServletResponse response, 
                  FilterChain chain) throws IOException, ServletException {
              try {
  
                  HttpServletRequest reqt = (HttpServletRequest) request;
                  HttpServletResponse resp = (HttpServletResponse) response;
                  HttpSession ses = reqt.getSession(false);
  
                 String reqURI = reqt.getRequestURI();
                 if (reqURI.indexOf("/login.xhtml") &gt;= 0
                          || (ses != null &amp;&amp; ses.getAttribute("username") != null)
                          || reqURI.indexOf("/public/") &gt;= 0
                          || reqURI.contains("javax.faces.resource"))
                      chain.doFilter(request, response);
                 else{
                      resp.sendRedirect(reqt.getContextPath() + "/faces/login.xhtml");
                 }
              } catch (Exception e) {
                  System.out.println(e.getMessage());
              }
  }
  </code></pre>