- 名师讲坛:Java微服务架构实战(SpringBoot+SpringCloud+Docker+RabbitMQ)
- 李兴华
- 212字
- 2025-02-25 22:28:58
3.3 Thyemeleaf静态资源
在进行Web信息显示的过程中,除了可以配置动态显示页面之外,也可以配置静态资源(如*.html、*.css、*.js等)。对于静态资源,要求其必须放在源文件夹的static目录中。本项目的页面结构如图3-4所示。

图3-4 项目结构
1.【mldnboot-thymeleaf项目】建立项目所需要的CSS样式文件以及JS脚本文件。

messge_index.js文件的主要功能是在控制台进行提示信息输出。
2.【mldnboot-thymeleaf项目】在src/main/view/static目录下建立message_index.html页面。

本程序修改了页面运行的icon图标,并且引入了相应的静态资源,页面运行效果如图3-5所示。

图3-5 Thymeleaf静态页面