File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL access operator

 
amarkirt saroay
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this true:


If the dot operator is used to access the bean property but the property does not exist ,then a runtime exception is thrown !
 
Siphiwe Madi
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The is only one way to find out. "Try it".

Regards,
Siphiwe Madi
[SCJP, __, __]
Next ... scwcd, scjwsd
 
Ravi Bansal
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it will return null and EL simply ignores null values........
 
Katrin Perry
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If the bean doesn't exist (not found in any of the scopes) -> null, which is ignored and no Exception would be thrown.

If on the other hand the bean exists (it is found in one of the scopes), but you try to reference a property that doesn't exist an Exception would be thrown.

I hope that this helps.

Thanks
Katrin
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi Bansal wrote:it will return null and EL simply ignores null values........

Incorrect.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic