Help with Apache Velocity | Community
Skip to main content
December 17, 2015
Solved

Help with Apache Velocity

  • December 17, 2015
  • 1 reply
  • 1290 views

Hi guys,

Does anyone have any clue why the scenario described in screenshot happens?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by

Found the problem:

to check for null in velocity, dont use

${variable} == ''

this wont work either

${variable} == 'null'

or any combination of quotes and what have you. What does work is a simple if:

#if ($variable)

... do stuff here if the variable is not null

#end

Cheers!

1 reply

Accepted solution
December 17, 2015

Found the problem:

to check for null in velocity, dont use

${variable} == ''

this wont work either

${variable} == 'null'

or any combination of quotes and what have you. What does work is a simple if:

#if ($variable)

... do stuff here if the variable is not null

#end

Cheers!