3

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?

Roman C
  • 49,761
  • 33
  • 66
  • 176
user182944
  • 7,897
  • 33
  • 108
  • 174

1 Answers1

2

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.

Roman C
  • 49,761
  • 33
  • 66
  • 176