I have added a login to my JSF aplication and when I tested it in FireFox it keeps resend form data on refresh.
I have look through this question and links, but I didn't catch what is going on.
Here is my 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") >= 0
|| (ses != null && ses.getAttribute("username") != null)
|| reqURI.indexOf("/public/") >= 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());
}
}