Hi,
How do I read System.getProperty(foo) within a Velocity file? I need
this to read a property and take corresponding action at the time of
initialization of my application. I can not put this code in any of the
methods within my Servlets and call the corresponding method from my
Velocity as
Hi Robert,
I've had some similar issues. When my XML editor (or HTML editor) requires
the source to be well-formed, I just use the first case you suggestion.
The other alternative is to use a macro to abstract out the entire input
block. It's not well-formed XML, but it's more easily
Hi Pras,
How do I read System.getProperty(foo) within a Velocity file? I need
this to read a property and take corresponding action at the time of
initialization of my application. I can not put this code in any of the
methods within my Servlets and call the corresponding method from my
Hi All
How to handle this sort of warning?
Velocity [warn] Warning! The iterative is an Iterator in the
#foreach() loop at 0,0] in template /data.vm. Because it's not
resetable, if used in more than once, this may lead to unexpected
results.
Thanks
Raj
It's just a warning. If you send an Iterator object to a foreach
loop, it will work exactly once in the template. If you are only
using it once, then that's not a problem.
In best practice, you would always try to send an array or an object
that implements java.util.Collection to a foreach