tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Helios Alonso <halo...@atg.com.uy>
Subject Dynamic evaluation via brackets
Date Thu, 02 Sep 2004 15:16:18 GMT
from http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html | Chapter 12 
| EL | Variables

----------------------------

The JSP expression language unifies the treatment of the . and [] 
operators. expr-a.expr-b is equivalent to a["expr-b"]; that is, the 
expression expr-b is used to construct a literal whose value is the 
identifier, and then the [] operator is used with that value.

To evaluate expr-a[expr-b], evaluate expr-a into value-a and evaluate 
expr-b into value-b. If either value-a or value-b is null, return null.

     * If value-a is a Map, return value-a.get(value-b). If 
!value-a.containsKey(value-b), then return null.
     * If value-a is a List or array, coerce value-b to int and return 
value-a.get(value-b) or Array.get(value-a, value-b), as appropriate. If the 
coercion couldn't be performed, an error is returned. If the get call 
returns an IndexOutOfBoundsException, null is returned. If the get call 
returns another exception, an error is returned.
     * If value-a is a JavaBeans object, coerce value-b to String. If 
value-b is a readable property of value-a, then return the result of a get 
call. If the get method throws an exception, an error is returned.

-----------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message