PDA

View Full Version : Configuring Velocity Tools with VelocityViewResolver



frederik
Sep 2nd, 2004, 03:04 PM
Hi all,

I'm in the middle of migrating our application to Spring MVC and got stuck on how to configure Velocity Tools with VelocityViewResolver. Is there an easy way to do this? Should I implement subclasses of VelocityViewResolver and VelocityView to handle other/custom tools of the Velocity Tools set? Any other ideas/possibilities?
Any help kindly appreciated on this.

Frederik

davison
Sep 4th, 2004, 05:30 PM
which tools are you interested in? VelocityView allows NumberTool and DateTool to be exposed by setting appropriate bean properties on it (see http://www.springframework.org/docs/api/org/springframework/web/servlet/view/velocity/VelocityView.html
).

If you need additional tools, they can be specified in the exposeHelpers method of an extended VelocityView class.

hth

frederik
Sep 5th, 2004, 04:18 PM
Darren,

Thanks for your answer. I just had a look at the source code of the VelocityView class and this should be rather easy to implement.

We've coded some additional customized Velocity tools that we used together with the VelocityViewServlet. As we want the MVC part to be completely handled by Spring we need to get rid of this VelocityViewServlet.

Kind regards,

Frederik