How to load VM_global_library.vm for Velocity in Spring Boot? -
we're using velocitylayoutservlet view resolver in spring boot.
@bean(name = "velocityviewresolver") public velocitylayoutviewresolver velocityviewresolver() { velocitylayoutviewresolver resolver = new velocitylayoutviewresolver(); this.properties.applytoviewresolver(resolver); resolver.setlayouturl("layout/default.vm"); return resolver;}
we want load global macros vm_global_library.vm file, described in velocity user guide. expected velocity load default file /templates directory, not happening.
adding theexplicit setting mentioned in velocity user guide did not work either: spring.velocity.velocimacro.library=vm_global_library.vm
velocimacro.library - comma-separated list of velocimacro template libraries. default, velocity looks single library: vm_global_library.vm. configured template path used find velocimacro libraries.
are missing magic, or missing integration?
velocity properties can set "spring.velocity.properties.*" attribute. configuration works me:
spring.velocity.properties.velocimacro.library=templates/vm_global_library.vm
Comments
Post a Comment