Setting values versus getting values

As stated before, some values that are gettable are not also settable because of the nature of the expression. For example,

names[0].location

is a settable expression - the final component of the expression resolves to a settable property.

However, some expressions, such as

names[0].length + 1

are not settable because they do not resolve to a settable property in an object. It is simply a computed value. If you try to evaluate this expression using any of the Ognl.setValue() methods it will fail with an InappropriateExpressionException.

It is also possible to set variables using get expressions that include the '=' operator. This is useful when a get expression needs to set a variable as a side effect of execution.