Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why Inconsistency Between map and Bean(EL)?

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why there is inconsistency beween map and bean
i want to say if we try to print property of bean using EL and if bean property is not available the server throws Exception
For Ex-:
${myBean.property}
if property of bean named myBean is not present the server throws Exception.
but if we use map shown below and there is no key named key present the server does not throws Exception.
${myMap['key']}
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe because in a Map, there can be anything. And there may not be things you're looking for.
However, in a bean, there can't be anything. Only properties you've defined.

So looking for something that does not exist in a map is not a scandal, but looking for a property that does not exist in a bean is rather strange.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic