The question which immediately arises is: how do I get from my velocity template to my spring beans?
1. The first stop is the VelocityVariable class from Liferay.
there your fine "serviceLocator" variable which sound just as the right variable to use.
2. In your tpl file add the following
- $serviceLocator.findService("versionBean").getVersion()
3. You may think now that you only have to configure a Spring bean named "versionBean". Wrong!
The bean name must be augmented with ".velocity" and the bean you are talking to is not yours, but the "ProxyFactoryBean" in which you inject your bean!
4. The Java bean class is up to you then.
Thanks you Martin for your help with this one.