自由标记:基于属性的模型

发布于 2025-02-11 05:44:16 字数 209 浏览 0 评论 0原文

一样的表达式

<#if property.name == "true">

如果我正确理解FreeMarker的MapModel,那么像图片 会找到对象“属性”。而且,如果那是一张地图,请在内图中查找值“名称”。

现在,假设我的地图是一个属性对象,我希望“属性。名称被评估为属性“属性”的值。名称”?可能是吗?如何?

If I understand Freemarker's MapModel correctly, then an expression like

<#if property.name == "true">

would look into the map, finds an object "property". And, if that's a map, looks up the value "name" in the inner map.

Now, assume, that my Map is a Properties object, and I would want "property.name to be evaluated a s the value of property "property.name"? Is that possibly? How?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昔梦 2025-02-18 05:44:17

它应该与java.util.properties一起使用,因为它实现了java.util.map

It should just work the same with java.util.Properties, because that implements java.util.Map.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文