Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I check for a Null value using Velocity Template Language?

843838Aug 12 2006 — edited Aug 14 2006
Hello All,

Yes, this is not a JSP topic but it's the best place I could find to post this question as the Velocity site (http://jakarta.apache.org/velocity/index.html) doesn't appear to have a forum.

My question is how to deal with a Null value that I'm pulling from a Java object that is being passed to Velocity through the session. The $type (see below) refers to my class and the ApIntSchdTypeRunWorkday (see below) refers to my getApIntSchdTypeRunWorkday() method in that class. That method will sometimes return a Null value which causes Velocity to display the actual code, $type.ApIntSchdTypeRunWorkday, instead of a blank.

$type.ApIntSchdTypeRunWorkday

Using Velocity, how do I check to see if the method is returning a Null so I can change it to a blank value? At this point modifing the Java object before it gets to Velocity is not an option.

Thanks for your help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2006
Added on Aug 12 2006
2 comments
2,719 views