This revision made August 26, 2011 22:18, by Kin-man Chung

A # B

- Coerce A and B to String. Note: according 1.18.2, a
*null*is coerced to "". - Return the concatenated string of A and B.

The precedence for # is lower than "+" and "-" (binary) but higher than logical operators (== != etc.)

1 # 2 returns "12"

"1" # "2" returns "12"

expr-a = expr-b

- expr-a must be a
*lvalue*, and must be either a single variable (e.g. name) or a property resolution on some object, via . or [] operator. (e.g. employee.name). Note that this rule will be automatically enforced by setting the ELResolvers to be writable only for these syntaxes. - Evaluate expr-a, up to (but not including) the last property resolution.
- If expr-a is a . or [] operator, evaluate the base to base-a, and the property to prop-a.
- If base-a is null, throw a BeanNotFoundException.
- If prop-a is null, throw a PropertyNotFoundException.

- If expr-a is a single variable var.
- If var cannot be resolved and is therefore non-existent, create it as an EL variable in the ELContext.

- If expr-a is a . or [] operator, evaluate the base to base-a, and the property to prop-a.
- Evaluate expr-b to value-b.
- Invoke ValueExpression.setValue for expr-a:
- expr-a.setValue(context, value-b);

- If ValueEpxression.getValue was called to initiate this expression evaluation, return value-b.
- If ValueExpression.setValue was called to initiate this expression evaluation, throw a PropertyNotWritableException.

The last two bullet items ensure that the assignment operator returns the correct value, and that it is not writable.

It has the lowest precedence, lower than the ?: operator.

"x = a.b" If x does not exist then same as calling defineVariable("x", "#{a.b});

"x.y = a.b" Set x.y = a.b. Error if x does not exist.

Difference compared to previous revision

=Operators=
==String Concatenation==
===Syntax===
A # B
# Coerce A and B to String. Note: according 1.18.2, coercing =Operators=
==String Concatenation==
===Syntax===
A # B
# Coerce A and B to String. Note: according 1.18.2, a ''null''a null String is rcoeturnserced ato "".
# Return the concatenated string of A and B.
===Operator Precedence===

Please Confirm