Freemarker Booleans in Beans
Note to self, making model beans that you want to use in Freemarker? Make sure them boolean's are java.lang.Boolean (in the docs) and change your getters from isMyBool() to getMyBool() (not in the docs), otherwise it's headscratching time trying to figure out why it can't find your junk.
Expression command.myBooleanis undefined on line 262, column 6 in WEB-INF/freemarker/verify.ftl.
The problematic instruction:
----------
==> if command.myBoolean [on line 262, column 1 in WEB-INF/freemarker/verifyStudy.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression command.myBoolean is undefined on line 262, column 6 in WEB-INF/freemarker/verify.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.isTrue(Expression.java:145)
Most important though is to get on junit testing your freemarker views. Getting this all set was such a lovely vindication of sorts for me. Nice tests all the way from the DB to the web? Without this testing the above would've been misery. Now? I just feel pretty much invincible.
Expression command.myBooleanis undefined on line 262, column 6 in WEB-INF/freemarker/verify.ftl.
The problematic instruction:
----------
==> if command.myBoolean [on line 262, column 1 in WEB-INF/freemarker/verifyStudy.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression command.myBoolean is undefined on line 262, column 6 in WEB-INF/freemarker/verify.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.isTrue(Expression.java:145)
Most important though is to get on junit testing your freemarker views. Getting this all set was such a lovely vindication of sorts for me. Nice tests all the way from the DB to the web? Without this testing the above would've been misery. Now? I just feel pretty much invincible.