I have a page1.jsf, in this page i have a commandButton that put an object in ELFlash, and redirects to page2.jsf. In this page i recover the object by ELFlash. Everything w
I think that problem might be related to http chunking. Solution is to increase response buffer size. After that cookies will be set correctly and Flash Scope should work too.
Use this code:
public class FlashScopeFixerFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// Below line: response.getWriter() must be invoked to buffer size setting work. Just DO NOT touch this!
response.getWriter();
HttpServletResponseWrapper wrapper = new HttpServletResponseWrapper((HttpServletResponse) response);
wrapper.setBufferSize(10000000);
chain.doFilter(request, wrapper);
}
@Override
public void init(FilterConfig arg0) throws ServletException {}
@Override
public void destroy() {}
}
And in web.xml:
FlashScopeFixerFilter
dk.sd.medarbejderdata.common.FlashScopeFixerFilter
FlashScopeFixerFilter
*.xhtml