Velocity is a java-based template engine that allows anyone to reference objects defined by java code simply using the template language. Configuration: 1. in pom. add the dependent velocity package in xml [html] <dependency> <groupId> velocity </groupId> <artifactId> velocity </artifactId> <version> 1.5 </version> </dependency> 2. add the following content to the servlet-context.xml If jsp configuration first comment out [html] <beans: bean id = "velocityConfig" <span style = "white-space: pre "> </span> class =" org. springframework. web. servlet. view. velocity. velocitycycler "> <beans: property name =" resourceLoaderPath "value ="/WEB-INF/vie Ws "/> <beans: property name =" configLocation "value =" classpath: common/velocity. properties "/> </beans: bean> <beans: bean id =" velocityViewResolver "class =" org. springframework. web. servlet. view. velocity. velocityViewResolver "> <beans: property name =" suffix "value = ". htm "/> </beans: bean> 3. create velocity in the resources/common directory. properties [html] # encoding input. encoding = UTF-8 output. encoding = UTF-8 contentType = tex T/html; charsets = UTF-8 # autoreload when vm changed file. resource. loader. cache = false file. resource. loader. modificationCheckInterval = 1 velocimacro. library. autoreload = false 4. create testController [java] @ RequestMapping (value = "/test") @ Controller public class TestController {@ RequestMapping (value = "/index") public String index (Model model) {String name = "tester"; model. addAttribute ("name", name); return" Test/index ";}}5. Create a test/index.htm template