本来没有打算学习velocity模板引擎的,看到solr的browse中应用的是velocity,就简单地学习了一下。
在浏览器中输入: 则可以看到index.vm的效果。
如果我们自己开发,怎么办呢?
如果直接复制simple项目中的web.xml,则有可能报错:Can not find the tag library descriptor for "http://velocity.apache.org/velocity-view"
把web.xml中的
换成
- <web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
就不会报错了。