Can you please explain why would
requestScope[integer] return 0 but
requestScope["integer"] or requestScope['integer'] return 3
requestScope[integer] return 0
- It will look for a attribute with the name 'integer', and it will find the value of this attribute as 3. But till now this expression has not looked into requestScope. Its just the EL which is being processed. Now, it will look for the 4th element in the requestscope and it will not find anything as there are only 3 elements (0,1,2). So, it will return 0.
But it we do this -
requestScope["integer"] or requestScope['integer'] return 3
It will look for a map value with the key 'integer' and it will find the second key in the map and return the value 3.