Monday, April 7, 2014

Accessing an element in the Java array or map using expression language?

Sometimes we might have the Java List or Map in the managed bean and we might want to access an element using either the index of the List or the Key of the Map.

We access the elements in the same manner for both the above cases and the code is as below.

value="#{viewScope.treeTableModel.newEmployeeMap['key']}"

or 

value="#{viewScope.treeTableModel.newEmployeeList[vs.index]}"

No comments:

Post a Comment