Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
Angularjs JHipster/Angular配置如何确定需要使用index.html文件?_Angularjs_Spring Mvc_Jhipster - Fatal编程技术网

Angularjs JHipster/Angular配置如何确定需要使用index.html文件?

Angularjs JHipster/Angular配置如何确定需要使用index.html文件?,angularjs,spring-mvc,jhipster,Angularjs,Spring Mvc,Jhipster,我刚刚使用JHipster生成了一个Spring/Angular应用程序 我使用以下URL成功访问了主页:http://localhost:8080它重定向到http://localhost:8080/#/和index.html文件已正确加载 我不确定Angular和浏览器是否确定需要加载index.html文件 JHipster应用程序中的配置在哪里 编辑:是否有一些“默认主页”配置 我使用以下URL成功访问了主页: 哪个重定向到 对服务器的请求是“/”并提供index.html。“/#/”是

我刚刚使用JHipster生成了一个Spring/Angular应用程序

我使用以下URL成功访问了主页:
http://localhost:8080
它重定向到
http://localhost:8080/#/
index.html
文件已正确加载

我不确定Angular和浏览器是否确定需要加载
index.html
文件

JHipster应用程序中的配置在哪里

编辑:是否有一些“默认主页”配置

我使用以下URL成功访问了主页: 哪个重定向到

对服务器的请求是“/”并提供index.html。“/#/”是index.html页面上的javascript启动时发生的所有客户端内容(角度路由),而不是服务器端重定向的结果

JHipster应用程序中的配置在哪里

这是一个Spring引导默认值,不是JHipster特有的。从:

自动配置在Spring的基础上添加了以下功能 默认值:

  • 静态index.html支持
默认情况下,SpringBoot将提供目录中的静态内容 在中调用/static(或/public或/resources或/META-INF/resources) 类路径或从ServletContext的根开始。它使用 来自SpringMVC的ResourceHttpRequestHandler,您可以修改它 通过添加您自己的WebMVCConfigureAdapter并重写 addResourceHandlers方法


我不认为这是通过属性文件或类似的东西来配置的,您需要编写一些代码。看吧。

非常感谢约翰!相关代码可以在class
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
中找到。