In the test
attribute of the s:if
tag you don't need to put %{}
. This abbreviation is used to mark the scope of OGNL expression and removed before evaluation. While evaluating it's searching for variable version
in the valueStack
. The action object is on top
of the valueStack
, so if it finds a property with the name version
it will execute getVersion()
to return a result. If it didn't find the version
at the action it will continue to search the whole valueStack
until it find the property with the name version
. More or like the same is described in the documentation.
XWork has a special OGNL PropertyAccessor that will automatically look at the all entries in the stack (from the top down) until it finds an object with the property you are looking for.