An easy way is to define a VelocityViewServlet in web.xml
<servlet> <servlet-name>view</servlet-name> <servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class> <init-param> <param-name>org.apache.velocity.properties</param-name> <param-value>/WEB-INF/velocity.properties</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>view</servlet-name> <url-pattern>*.vm</url-pattern> </servlet-mapping>
In the parameters velocity.properties
Then put your template in the root of your web browser and access it from the web browser using its name as the URL. eg.
http:
source share