2010-06-28 28 views
2

通常我在freemarker中使用这种类型的数据:可以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 = "https://stackoverflow.com/questions/ask" 

他要我在最后一页显示目录的价值。 模板:

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

我建议他写一个模板这样

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

,但他不希望做这样this.I要问,如果有任何的方式来实现这一要求。

回答

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

这就是答案