SpringBoot_web开发-【实验】-引入资源

像js和css等可以放在resouces/static目录下,而html最好放在resouces/template,只要引入了thymeleaf,在返回逻辑视图时,会有去扫描resouces/template下查看是否有需要的html文件(不需要加.html后缀)

   》在html页面想要引用其他的静态资源,比如css,js等,可以通过thymeleaf提供的@{}引用url,它的好处是假设访问的url需要改变,可以通过配置文件的方式给其原url加前缀

 

原文地址:https://www.cnblogs.com/ibcdwx/p/13654225.html