SpringBoot1.5以上版本兼容velocity,不降级spring

时间:2021-09-18 10:05:11
【文件属性】:
文件名称:SpringBoot1.5以上版本兼容velocity,不降级spring
文件大小:39KB
文件格式:ZIP
更新时间:2021-09-18 10:05:11
springboot2 Spring boot1 velocity 支持 SpringBoot1.5以上版本兼容被抛弃的velocity,详情说明见项目README.md。 # springboot1.5.x+ velocity2 springboot maven 搭建 springboot1.5以上因不支持velocity 问题的核心在于高版本的springboot已经删除了velocity支持的类 PS: 网上解决方法: 1.降低pring-context-support版本,但是强制降级影响其他代码运行因此发布一个不降低版的方法 2.依赖velocity-engine-core 但是都没啥用样,我是sptingboot2.0不知道其他的,百度都是坑,还是靠自己 这里完美解决不支持问题,支持任意版本的spring 配置 1.在pom中添加 <!-- velocity视图解析 --> org.springframework.boot spring-boot-starter-velocity 1.3.6.RELEASE 2.导入本项目中的org.springframework目录下的velocity支持类,原样copy过去或自己打个jar 3.不想写java类配置就直接@ImportResource({"classpath:velocity.xml"})原来的xml配置 4.其他原来是啥就是啥开工
【文件预览】:
src
----.DS_Store(6KB)
----test()
--------java()
----main()
--------resources()
--------java()
README.md
pom.xml

网友评论