apachetomcatvelocitycustomtool

Apache Velocity + Tomcat: Manually process templates within web-app


I am using Apache Tomcat with Velocity and VelocityViewServlet. I have created a custom tool with refference to ViewContext. It all works well.

The question is: what is best way to locate/load template and procces it with suplied parameters?

I have already absolute path to the file obtained via

((ViewContext)context).getRequest().getSession().getServletContext().getRealPath("/")

Solution

  • Several points here: