Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
WW 2.0, WW 2.1, WW 2.1.1, WW 2.1.2, WW 2.1.3, WW 2.1.4, WW 2.1.5, WW 2.1.6, WW 2.1.7
-
None
Description
This would allow chained context's to be able to be loaded from spring or other object factorys.
It is a simple one line change in the init() method:
FROM:
VelocityContext velocityContext = (VelocityContext)
ObjectFactory.getObjectFactory().buildBean(Class.forName(classname));
TO:
VelocityContext velocityContext = (VelocityContext)
ObjectFactory.getObjectFactory().buildBean(classname);
e.g. don't do Class.forName. Let the object factory figure it out.
after this toolbox like things can be wired in.
e.g
<bean id="springToolboxContext"
class="org.apache.velocity.VelocityContext" >
<constructor-arg>
<map>
<entry key="dateTool">
<ref bean="dateTool"/>
</entry>
</map>
</constructor-arg>
</bean>
<bean id="dateTool" class="org.apache.velocity.tools.generic.DateTool"/>
Matthew Payne