Some basic information:
I am using velocity 1.4 with Tomcat 5.5.17, and all my servlets extend the class
org.apache.velocity.servlet.VelocityServlet
And that part is working fine.
But now I am trying to set the directive.foreach.counter.initial.value to 0 so
my loop count begin with 0 insted of 1. And I just can't get it to work.
I started with something simple, trying to do a
org.apache.velocity.app.Velocity.setProperty("directive.foreach.counter.initial.value","0");
in my servlet initialization code. But that had no effect. So I tried
Vorg.apache.velocity.app.Velocity.setProperty("directive.foreach.counter.initial.value",new
Integer(0));
But that did not work either. The value of
directive.foreach.counter.initial.value is still 1.
Is this because the org.apache.velocity.app.Velocity class is meant to be used
in stand alone applicatinos only?
Well then I tried to make a velocity.properties file.
A cut from my web.xml file is
<servlet>
<init-param>
<!-- Should this not be org.apache.velocity.properties -->
<param-name>properties</param-name>
<param-value>/velocity.properties</param-value>
</init-param>
<servlet-name>MyGallery</servlet-name>
<servlet-class>twgc.MyGallery</servlet-class>
</servlet>
But it still seems like velocity don't pickup my velocity.properties file. All
the log say about properties are
[info] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
So no error message, or anything that indicate it have loaded my properties
file. So what am I doing wrong?
Martin Tilsted
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]