2

通常我在freemarker中使用这种类型的数据:

(root)  
|  
+- website = "StackOverflow"  
|  
+- href = "http://stackoverflow.com"  
|  
+- label = "my favorite website."

但是今天,一个java程序员给了我一个这样的模型:

(root)  
|  
+- website = "StackOverflow"  
|  
+- href = "http://stackoverflow.com${dir}"  
|  
+-  label = "my favorite website"  
|  
+- dir = "/questions/ask"

他希望我在最后一页展示 dir 的价值。模板:

${label}<a href="${href}" >${website}</a>

我建议他写一个这样的模板

${label}<a href="${href}${dir}" >${website}</a>

但他不想这样做。我想问有没有办法实现这个要求。

4

1 回答 1

4
${label}<a href="<@href?interpret/>" >${website}</a>

这就是答案

于 2010-06-29T03:11:28.753 回答