Bookmark Topic Watch Topic
  • New Topic

Using EL with [] and . operator

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
MyBean is a java bean with property param that is of type Map.
a is on of the element of this property.

then,


Is ${mybean.["param"].a} correct ?

where mybean is attribute of type of MyBean.

i think it incorrect and the correct El should be ${mybean.param.["a"]}

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2419
95
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
i think it incorrect and the correct El should be ${mybean.param.["a"]}

No, both are ok, but be carefull with the "." it should be like this:


Regards,
Frits
 
    Bookmark Topic Watch Topic
  • New Topic