【问题标题】:Struts 2 - The usage of %{ } notationStruts 2 - %{ } 符号的使用
【发布时间】:2013-08-28 15:06:40
【问题描述】:

Struts 2 中%{} 符号的确切用途是什么?有人可以用一个简单的例子来解释一下代码在使用%{} 时有效,而在不使用时无效?

【问题讨论】:

标签: java web-applications struts2 ognl webwork


【解决方案1】:

在 OGNL 中用于强制将括号中的内容评估为 OGNL 表达式。例如

<s:iterator value = "myAnswers" status="stat">
<s:textfield name = "myAnswers[%{#stat.index}].name"/> 

应该强制评估stat.index

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-19
  • 1970-01-01
  • 1970-01-01
  • 2011-03-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多