Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/424.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从模板文件夹Spring访问javascript文件_Javascript_Java_Angularjs_Spring Mvc_Spring Boot - Fatal编程技术网

从模板文件夹Spring访问javascript文件

从模板文件夹Spring访问javascript文件,javascript,java,angularjs,spring-mvc,spring-boot,Javascript,Java,Angularjs,Spring Mvc,Spring Boot,我有一个Spring启动应用程序,它使用angular和thymeleaf。该项目的结构使html文件与javascript文件一起存储。我的问题是没有提供javascript文件(得到404)。我知道spring启动服务器是静态文件夹中的js和css文件,我如何配置它来查找这些文件 文件夹结构 resources ----static ----templates --------view index.html app.js ---------account

我有一个Spring启动应用程序,它使用angular和thymeleaf。该项目的结构使html文件与javascript文件一起存储。我的问题是没有提供javascript文件(得到404)。我知道spring启动服务器是静态文件夹中的js和css文件,我如何配置它来查找这些文件

文件夹结构

resources
----static
----templates
--------view
         index.html
         app.js
---------account
         accountPage.html
         accountCtrl.js
index.html


如何使用此文件结构从index.html加载app.js文件?

请参见以下答案-。你也可以看看另一个问题——谢谢你,这个问题解决了