Re: Simple Question about FreeMarker + Struts 2

2007-09-11 Thread Kenton
I identified the issue and this isn't related to NULL references. To summarize: This syntax will work with a getter method OR directly with the raw member variable if the getter method isn't present: <@s.property value="myActionProperty.subProperty" /> This syntax requires a getter method and wo

Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Jim Cushing
Some other things you can use: ${myActionProperty.subProperty!} Prints nothing if subProperty doesn't exist or is null ${myActionProperty.subProperty?default("default value") Prints "default value" if subProperty doesn't exist or is null The first expression (ending with !) is most similar in

Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Zarar Siddiqi
Freemarker considers null references errors. When myActionProperty.subProperty is referenced in the Struts tag, it is printed regardless of its value. However, when Freemarker encounters ${myActionProperty.subProperty}, it will give you an error if subProperty is null. When trying to print Freem