You can probably use a hack with classloader. Along the lines of:
#set($x =
"1".getClass().getClassloader().findClass("java.uti.HashSet").newInstance())
Alex
On Thu, Jan 25, 2018 at 11:30 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:
> -BEGIN PGP SIGNED MESSAGE-
>
I am guessing that you can also install a reference insert handler in your
setup and handle null values there as needed.
Alex
On Thu, Dec 7, 2017 at 9:35 AM, Claude Brisson
wrote:
> I looked at the code, and, well, it looks like the strict mode is ...
> rather
It does not work because bodyContent is an instance of the ASTNode class
and not a string, so it does not have the trim method.
Use something like this:
#macro(my_trim)#set($str=$bodyContent)$str.trim()#end
Test:
before#@my_trim()-blah- #{end}after
Renders:
before-blah-after
On Wed,
Simple way:
#set($str=#default_query_url())
$str.trim()
Can probably create a helper macro trim that does the same thing to the
body content:
#@trim()
#default_query_url()
#end
On Thu, Aug 1, 2013 at 1:27 PM, O. Olson olson_...@yahoo.it wrote:
Hi,
I am new to using Apache Velocity.
?
On Thu, Jul 19, 2012 at 10:26 AM, Alex Fedotov a...@kayak.com
wrote:
I think that Velocity has one global hash table for macros from
the
*.vm
libraries and that is more or less static for the life time of
the
Velocity
engine.
I wish
I think that Velocity has one global hash table for macros from the *.vm
libraries and that is more or less static for the life time of the Velocity
engine.
I wish there there was a mechanism to control the list of the *.vm files
and their order of lookup for each individual merge (thread). This
Another option may be rewriting the AST tree after the template is parsed
and replacing some nodes with text or something else.
I tried that on the side as an experiment to inject some security checks
and collect profiling info for macros and templates.
Alex
On Fri, Jul 13, 2012 at 9:50 AM,
Well, I did not get into the details, but the idea would be to replace the
ASTIfStatement with a sequence of AST nodes that would output the #IF
text followed by the result of rewriting the children, etc. followed by the
#END text.
I think the SimpleNode does not have a particularly friendly