You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Robert Papp (Jira)" <ji...@apache.org> on 2025/02/19 23:57:00 UTC
[jira] [Created] (FREEMARKER-230) Consider BeansWrapper configuration items re Java records
Robert Papp created FREEMARKER-230:
--------------------------------------
Summary: Consider BeansWrapper configuration items re Java records
Key: FREEMARKER-230
URL: https://issues.apache.org/jira/browse/FREEMARKER-230
Project: Apache Freemarker
Issue Type: Improvement
Components: engine
Affects Versions: 2.3.33
Reporter: Robert Papp
Will {code}exposeFields = true{code} expose JVM Record function backing fields?
Should {code}exposureLevel = EXPOSE_PROPERTIES_ONLY{code} expose JVM record functions?
Whatever the answer, please document the expected behavior in their Javadoc.
I got bitten by this because I have {{EXPOSE_PROPERTIES_ONLY}} and I migrated a working model from normal Java bean getters to records. I was greeted with:
{code}
FreeMarker template error:
No such bean property: name
---- FTL stack trace ("~" means nesting-related):
- Failed at: ${tag.name?url} [in template "some.ftl" at line 17, column 56]
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)