posted 15 years ago
Hi ,
Given if foo is a map:
1) ${foo["5"]} is valid syntax , here 5 will be a key into map.
2) ${foo.5} is not a valid syntax as whatever comes after dot must follow the identfier rules (as per HFSJ)
[See , maps and beans can use dot as well as [] operator (given whatever comes after dot must be a valid identifier)
Arrays and lists can only use [] operator , as indices will always be numerals and wont work with dot ]
You are right : For sure , we have numerals(as indices) with lists and arrays only but we can have numerals as keys in maps too but they will be accessed only using [] , not dot .
I hope , it makes sense.