Struts 2 - The usage of %{ } notation

此生再无相见时 提交于 2019-12-18 05:17:20

问题


What is the exact use of %{} notation in Struts 2? Can someone explain with a simple example where the code works when %{} is used and does not works when its not used?


回答1:


Used in OGNL to force evaluate the content in brackets as OGNL expression. For example

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

evaluation of the stat.index should be forced.



来源:https://stackoverflow.com/questions/18491659/struts-2-the-usage-of-notation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!