Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Push problem when recovering from server restart

James Starling
7 years ago Jun 10, 2015 6:21pm
James Starling
7 years ago Jul 23, 2015 5:28pm

My company ended up going through vaadin Pro services. There's an aknowledged issue here but they gave us a workaround. 

Create a filter in your web.xml


Then create the class you reference in the web.xml and extend javax.servlet.Filter. Override the doFilter(...) method. Here's what ours looks like.

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
    String transport = request.getParameter("X-Atmosphere-Transport");

    if (transport != null && transport.equals("close"))
        String contextPath = ((HttpServletRequest) request).getContextPath();
        ((HttpServletResponse) response).sendRedirect(contextPath);
        chain.doFilter(request, response);