This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/main by this push:
new 17cbe2326c WW-5823 docs: show which tags evaluate expressions in
dynamic attributes
17cbe2326c is described below
commit 17cbe2326c9011a86c48cfd88271bd6c472ac953
Author: Lukasz Lenart <[email protected]>
AuthorDate: Sat Oct 31 08:49:39 2026 +0100
WW-5823 docs: show which tags evaluate expressions in dynamic attributes
The FreeMarker support page claimed any tag evaluates an OGNL expression
placed in a dynamic attribute. Dynamic attributes passed through the
FreeMarker tag syntax are stored as given, and the simple theme evaluates
them only for radio and checkboxlist, once per list item. Point other
tags at FreeMarker interpolation and show the per-item form for the two
list tags.
Co-Authored-By: Claude Mythos 5.1 <[email protected]>
---
source/core-developers/freemarker-support.md | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/source/core-developers/freemarker-support.md
b/source/core-developers/freemarker-support.md
index 151183ad05..da699a9a25 100644
--- a/source/core-developers/freemarker-support.md
+++ b/source/core-developers/freemarker-support.md
@@ -146,10 +146,17 @@ and for both case, it will be parsed into:
```
-You can also use OGNL expressions with dynamic tags like below:
+A dynamic attribute is written out as given, so build its value with
FreeMarker's own interpolation:
```ftl
-<@s.textfield name="test" placeholder="input" foo="checked: %{bar}"/>
+<@s.textfield name="test" placeholder="input" foo="checked: ${bar}"/>
+```
+
+Only the tags that render one element per item of a list, `radio` and
`checkboxlist`, evaluate an OGNL
+expression in a dynamic attribute, once per item with that item on top of the
value stack:
+
+```ftl
+<@s.radio name="choice" list="choices" data-item="%{top}"/>
```
When using attributes with hyphens, use the below syntax (you can also leave
the single quotes from false if you want)