Loading...
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
TUTORIAL

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

Embedding Vaadin spring-boot application into HTML

Christoph Guse
5 years ago Jun 24, 2016 10:32am
Christoph Guse
5 years ago Jul 08, 2016 4:07pm
Alejandro Duarte
5 years ago Jul 12, 2016 5:39pm

Hi,

Hey! first of all, excellent way of asking on forums! I reproduced the problem and fixed it by adding the following script into the HEAD section of your HTML file:

<head>
...
<script>
XMLHttpRequest.prototype._originalSend = XMLHttpRequest.prototype.send;
var sendWithCredentials = function(data) {
  this.withCredentials = true;
  this._originalSend(data);
};
XMLHttpRequest.prototype.send = sendWithCredentials;
</script>
</head>

I created a pull request with the fix to your repository: https://github.com/flexguse/vaadin-html-embedding/pull/1

Christoph Guse
5 years ago Jul 12, 2016 7:27pm
Christoph Guse
5 years ago Jul 12, 2016 7:49pm

Hi Alejandro,

I found a working solution by replacing the CORSServlet by the filter based CORS support provided by spring-boot. The example is now working like a charm, the fonts are loaded properly.

I updated the example project and it's documentation.

Thanks a lot again for giving me the missed piece of JavaScript!

Cheers,
Christoph

Nikolay Kuzmin
5 years ago Dec 19, 2016 4:24am
Alejandro Duarte
5 years ago Dec 19, 2016 7:28pm
srini K
5 years ago Mar 04, 2017 3:08am
Alejandro Duarte
5 years ago Mar 06, 2017 10:19am
Cesar Quinteiro Rendo
4 years ago Oct 21, 2017 8:47am
Alejandro Duarte
4 years ago Nov 20, 2017 9:52am
Imran Momin
2 years ago Sep 17, 2019 8:18am
Alejandro Duarte
2 years ago Sep 17, 2019 8:57am
Imran Momin
2 years ago Sep 17, 2019 9:09am
Alejandro Duarte
2 years ago Sep 17, 2019 9:10am
Imran Momin
2 years ago Sep 17, 2019 9:19am
Alejandro Duarte
2 years ago Sep 17, 2019 9:29am
Imran Momin
2 years ago Sep 17, 2019 9:45am
Alejandro Duarte
2 years ago Sep 17, 2019 9:47am