where to add external JS

Hi peeps,
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:

@com.vaadin.annotations.JavaScript({"https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js", "resources/script.js" }) and a function call:

JavaScript.getCurrent().execute("" +"jsInit();" +""); 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
thanks

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?
thanks

I did it dynamically:

[code]
public static String readTextResource(Class someClass, String resourceName, String contentFormat)
{
InputStream inputStream = someClass.getClassLoader().getResourceAsStream(resourceName);
StringBuilder content = new StringBuilder();
if (inputStream != null)
{
InputStreamReader reader = new InputStreamReader(inputStream);
BufferedReader buffer = new BufferedReader(reader);
try
{
String line;
boolean isFirstLine = true;
while ((line = buffer.readLine()) != null)
{
if (!isFirstLine) content.append(Cmn.LS);
else
{
line = stripUTF8Header(line);
isFirstLine = false;
}
content.append(line);
}
}
catch (IOException ex)
{
Logger.getLogger(Cmn.class.getName()).log(Level.SEVERE, null, ex);
}
}
return content.toString();
}

[…]

@Override
protected void init(VaadinRequest vaadinRequest)
{
    [...]

    String jsCode = readTextResource(MyVaadinMain.class, "jquery-1.12.3.min.js");
    jsCode += "...someAdditionalCode...";
    JavaScript.getCurrent().execute(jsCode);
    [...]

}

[/code]And I put the jquery-1.12.3.min.js into the root folder of my project.
HTH, Martin.

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