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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin Push not work,an obvious BUG?
Server push (long polling)In my application does not work .I use the official vaddin-spring add-on ,and my app is based on springBoot.
After deeply debuging vaadin's code,I found the bug:
Vaadin framework integrates Atmosphere Framework to support push ,when the vaadin UI is inited ,the client will send a push request to the server:
http://localhost:8080/deeryo/vaadinServlet/PUSH?v-uiId=1&v-csrfToken=395f908b-73ad-44b9-8995-18678deb9cc1&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.13.vaadin3-jquery&X-Atmosphere-Transport=long-polling&
X-Atmosphere-TrackMessageSize=true&Content-Type=application%2Fjson%3B%20charset%3DUTF-8&X-atmo-protocol=true&_=1468289101510
but Atmosphere Framework determine the PushMode from reqeust header ,but not from the request query parameter.the code is:
AtmosphereResourceImpl.java
private TRANSPORT configureTransport() {
if (req == null) return UNDEFINED;
String s = req.getHeader(HeaderConfig.X_ATMOSPHERE_TRANSPORT);
if (s == null) return UNDEFINED;
if (s.equals(UNDEFINED.name()) && Utils.rawWebSocket(req)) {
return TRANSPORT.WEBSOCKET;
}
s = s.replace("-", "_").toUpperCase();
if (TRANSPORT.POLLING.name().equals(s)) {
return TRANSPORT.POLLING;
} else if (TRANSPORT.LONG_POLLING.name().equals(s)) {
return TRANSPORT.LONG_POLLING;
} else if (TRANSPORT.STREAMING.name().equals(s)) {
return TRANSPORT.STREAMING;
} else if (TRANSPORT.JSONP.name().equals(s)) {
return TRANSPORT.JSONP;
} else if (TRANSPORT.WEBSOCKET.name().equals(s)) {
return TRANSPORT.WEBSOCKET;
} else if (TRANSPORT.SSE.name().equals(s)) {
return TRANSPORT.SSE;
} else if (TRANSPORT.AJAX.name().equals(s)) {
return TRANSPORT.AJAX;
} else if (TRANSPORT.CLOSE.name().equals(s)) {
return TRANSPORT.CLOSE;
} else {
return UNDEFINED;
}
}
as a result, the transport is UNDEFINDE !!! So,my push(long-polling) can't work.
Hi,
are you sure that configureTransport method returns UNDEFINED?
In AtmosphereFramework.configureRequestResponse(...) query string parameters are put into AtmosphereRequest header map, so req.getHeader(HeaderConfig.X_ATMOSPHERE_TRANSPORT) should return the correct value.
I created a simple app with spring boot and vaadin using spring intializer, added vaadin-push dependency to the pom, annotated UI with @SpringUI and @Push(value = PushMode.AUTOMATIC, transport = Transport.LONG_POLLING) and everything is working fine