springboot-thymeleaf公共css/js 引入失败问题解决方案

springboot-thymeleaf公共css/js 引入失败问题解决方案

目前使用spring boot 框架时,大多使用得都是1.5.*左右的版本。
在以用thymeleaf 前端框架时候,总是会或多或少出现一些问题。
现在对该功能做一次系统全面的步骤解说:

pom.xml配置thymeleaf jar包

我们先以用thymeleaf相关的jar包

		
			org.springframework.boot
			spring-boot-starter-thymeleaf
		

引用完成后,查看pom.xml中的Dependency Hierarchy,可以看到thymeleaf中版本号为2.1.*
我们需要在标签中添加一下代码:

	
		3.0.2.RELEASE
		2.0.4
	

然后可以看到thymeleaf对应的jar包版本改为3.0.2

功创建公共文件commonCss.html




    
    
    The awesome application
	
	
	
	


需要单独引入特定的CSS文件


	LOGINING
	

这种情况,title和link都时必输项,不可为空

无需再引入其他CSS文件


    LOGINING

这种情况,title为必输项,不可为空

你可能感兴趣的:(前端,thymeleaf,thymeleaf,springboot,公共,css,js)