Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
where to add external JS
I'm just moved my whole js out of the java class in an external .js file as it is tidier, but I don't seem to be able to get the script called.
I added it here: src-->main-->webapp-->VAADIN-->themes-->mytheme-->resources-->script.js
In my java file I have this:
and a function call:
but when I test the app I get an error saying:
"NetworkError: 404 Not Found - http://localhost:8080/apptest/APP/PUBLISHED/resources/script.js"
I've had a look around but nowhere I couldn't find anywhere clear instructions as to exactly where the js file goes. Mine is a maven project using spring suite
Right, looks like if you put it in src/main/resources/my/vaadin/apptest (apptest being the name of my application) it works OK. There is another file in there by the way, MyAppWidgetset.gwt.xml, but it doesn't seem to be causing any problem. One thing I 'm wondering though is that in the same js file I'd like to add my connector (I know I shouldn't put it in the same file but for now that'll do because I'm pretty new to vaadin and I'd just like to get it working then if it does i'll move it to another js file). DO you reckon it would work?
I did it dynamically:
And I put the jquery-1.12.3.min.js into the root folder of my project.
Hi thanks for that, but I was looking for a static solution, so eventually I did what I said in my previous post and worked, cheers