Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
    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
Posts: 2777
174
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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!