• Post Reply Bookmark Topic Watch Topic
  • New Topic

bean property access in EL

 
Harshana Dias
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

How come in EL if we access a bean property which is not available it giving a runtime exception. EL suppose to handle null know which nothing should print?

eg: ${x.y} //x is bean and y is not available property

Thank You.

(HFSJ page 437 Q17 said so give runtime exception thrown)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65664
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nulls are handled just fine. If the property returns a null, the evaluation will be the empty string. A missing property is not the same as null.

Have you checked the Specification to see what it has to say?
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!