Re: java.lang.Boolean undefined
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Change isObjectBoolean to getObjectBoolean. JavaBeans introspector
only recognizes "isXxx" method as a property getter if its return type
is a primitive boolean.
Attila.
On 2009.06.30., at 17:48, Ben Storey wrote:
> Hi,
>
> I am having some problems with freemarker 2.3.14 and 2.3.15 when I am
> trying to extract a value that returns a java.lang.Boolean value and
> get this exception.
>
> Expression model.objectBoolean is undefined on line 1, column 64 in
> testObjectBoolean.ftl.
> The problematic instruction:
> ----------
> ==> ${model.objectBoolean?string} [on line 1, column 62 in
> testObjectBoolean.ftl]
> ----------
>
> Java backtrace for programmers:
> ----------
> freemarker.core.InvalidReferenceException: Expression
> model.objectBoolean is undefined on line 1, column 64 in
> testObjectBoolean.ftl.
> at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:
> 124)
>
>
> For example I have attached a test case that I have been running and
> the second test always fails even though the value has been set. Any
> help on how to resolve this issue would be greatly appreciated.
>
> Cheers
>
> Ben
> <
> BooleanFreemarkerTest
> .java
> >
> ------------------------------------------------------------------------------
------------------------------------------------------------------------------