本文转载自:https://www.cnblogs.com/chuanqimessi/p/4691921.html
1.在pom.xml中添加依赖
1 <dependency> 2 <groupId>org.apache.velocity</groupId> 3 <artifactId>velocity</artifactId> 4 <version>1.7</version> 5 </dependency> 6 <dependency> 7 <groupId>org.apache.velocity</groupId> 8 <artifactId>velocity-tools</artifactId> 9 <version>2.0</version> 10 </dependency>
2.从velocity-tools-2.0.jar的org.apache.velocity.tools.view包中复制出velocity.properties和tools.xml文件
到WEB-INF目录下,修改velocity.properties:
1 2 |
|
3.配置web.xml文件中的servlet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|