Re: java.lang.Boolean undefined
"Newman, John W" <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <D688C4D318A63D4290AA94A33E06F7D201C7ABB22D@msxmbxnsprd14.acct.upmchs.net> |
I've never tried this, but you might be able to: "You should create FooBeanInfo class extending SimpleBeanInfo for your Foo class (which has the Boolean property) and you should override the getPropertyDescriptors() method. This new class must be in the same package as your Foo class." Good luck... -----Original Message----- From: Attila Szegedi [mailto:[email protected]] Sent: Tuesday, June 30, 2009 12:12 PM To: FreeMarker-user Subject: Re: [FreeMarker-user] java.lang.Boolean undefined Truth be told, get/set works for boolean, so if you stick with get/ set, you can't go wrong. I sort-of agree with the sentiment, but that's the way it is. FreeMarker is not doing property discovery on its own, it uses the Java standard "java.beans.Introspector" class which implements the JavaBeans property protocol, and it is what it is... Attila. On 2009.06.30., at 18:06, Newman, John W wrote: > Try renaming isObjectBoolean to getObjectBoolean. Gotta love such a > quirky convention, I've got burnt by this a few times: boolean=is/ > set, Boolean=get/set... > > > > > > -----Original Message----- > From: Ben Storey [mailto:[email protected]] > Sent: Tuesday, June 30, 2009 11:48 AM > To: [email protected] > Subject: [FreeMarker-user] java.lang.Boolean undefined > > 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 ------------------------------------------------------------------------------ _______________________________________________ FreeMarker-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freemarker-user ------------------------------------------------------------------------------