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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
Need help integrating Vaadin into template
Hi,
This small test works without problems when I call it in a browser. When I click on the button I see a POST request to /vaadinServlet/UIDL/?v-uiId=5
@Theme("lei")
@Widgetset("com.eqs.lei.LeiWidgetset")
@SpringUI(path="/foo")
public class Foo extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
setContent(layout);
Button button = new Button();
layout.addComponent(button);
button.addClickListener(e -> {
layout.addComponent(new Label("OK"));
});
}
}
My spring boot application uses a ThymeLeaf include template which generates the following integration code:
<div>
<div id="vaadin-1" class="v-app lei">
<div class="v-app-loading"></div>
<noscript>
You have to enable javascript in your browser to use an application built with Vaadin.
</noscript>
</div>
<script type="text/javascript" src="/VAADIN/vaadinBootstrap.js?v=7.7.3"></script>
<script type="text/javascript">//<![CDATA[
vaadin.initApplication("vaadin-1", {
"theme": "lei",
"versionInfo": {
"vaadinVersion": "7.7.3"
},
"widgetset": "com.eqs.lei.LeiWidgetset",
"comErrMsg": {
"caption": "Communication problem",
"message": "Take note of any unsaved data, and <u>click here</u> or press ESC to continue.",
"url": null
},
"authErrMsg": {
"caption": "Authentication problem",
"message": "Take note of any unsaved data, and <u>click here</u> or press ESC to continue.",
"url": null
},
"sessExpMsg": {
"caption": "Session Expired",
"message": "Take note of any unsaved data, and <u>click here</u> or press ESC key to continue.",
"url": null
},
"vaadinDir": "/VAADIN/",
"debug": true,
"standalone": false,
"heartbeatInterval": 300,
"browserDetailsUrl": "/foo",
"serviceUrl": "/foo"
});
//]]></script>
</div>
When I click on the button now I see a request to /foo/UIDL/?v-uiId=5, resulting in a 404 error and displaying "Server connection lost, trying to reconnect...". Please help!
Thanks,
Roland
Last updated on
You cannot reply to this thread.