Spring Boot 應用程序中的 index.html 文件

尼克夏爾馬

我正在學習 Java Spring Boot MVC 框架。

默認的 HTML 文件必須命名為 index.html 並且必須位於 main/resources/templates 文件夾中。

我的問題是即使在保留 index.html 文件後,應用程序仍然可以工作。我什至刪除了文件 index.html 文件,但是當我使用 localhost 命令時,該頁面會顯示在瀏覽器中。

這怎麼可能?文件是否緩存在某處?

我使用 Eclipse 作為 IDE。

內存NAG

確保在安裝時執行乾淨,即 mvn clean install。它將確保項目中的所有模塊都被重建、打包和安裝。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

為什麼我的控制器中的根路徑映射到 Spring Boot Web 應用程序中的 index.html?

防止使用spring-boot缓存index.html文件

Junit 5 mockito無法在spring boot應用程序中讀取用@Value註釋的屬性文件

无法使用Spring Boot应用程序映射HTML文件

Spring Boot无法在webapp文件夹下找到index.html

在我的 Spring Boot 應用程序中存儲日誌的最佳應用程序是什麼?

NGINX-Spring Boot应用程序(“ /etc/nginx/html/index.html”未找到)

在 Spring Boot 应用程序中从数据库内容生成 HTML 文件

Spring Boot Thymeleaf:如何包含html文件

带有HTML文件的Spring Boot

無法從 Spring Boot 應用程序中設置的 DBRef 中刪除

Spring Boot 應用程序將空值插入到我的 mysql 表中

如何使用Spring Boot连接资源文件夹中的html文件?

如何在Spring Boot中在index.html上设置cookie或标头

Spring Boot jar找不到index.html

Spring Boot War无法找到index.html

Spring Boot和React无法加载index.html

无法通过Spring Boot提供静态index.html

我的Spring Boot Vaadin应用程序如何服务动态生成的HTML文件

Spring Boot/Angular 应用程序。路由一个完全自包含的 HTML 文件

Spring Boot应用程序看不到我的HTML文件

Thymeleaf + Spring Boot:将html放在子文件夹中

在Spring Boot中将HTML内容和图像存储在文件中时出错

从/ resources / templates文件夹中找不到.html页面的Spring Boot + JMustache 404错误

即使 Cassandra 關閉,Spring Boot 應用程序也應該啟動

Java Spring Boot:如何将我的应用程序根目录(“ /”)映射到index.html?

Spring Boot应用程序,我想使用applicaiton.properties配置index.html的位置,但是不起作用

Spring Boot中属性文件中的变量

在Spring Boot应用程序中读取清单文件