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

A Query....

 
Subramania Prasad M.K.
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one please hep me out with the answer for the following:

Is the following statement TRUE about EL access Operators.

-->If the . (dot) operator is used to access a bean property but the property doesn't exist.In such a case a Runtime exception is thrown.

Thanks
Prasad
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No , there will be no exception thrown
It will just print blank
for eg if you do the following in jSP

Hi , my name is ${foo.name} and foo is not present or name is not present
then the following output is shown
Hi , my name is

Refer to pg 395 of HFS&J for more details

Only thing you need to make sure is the part after dot is a valid Java identifier

for eg ${foo.1} will give an error since 1 is not a valid identifier name
 
trivikram Kumar
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah...thats perfectly right...

Javainn
 
Subramania Prasad M.K.
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clarifying. .Its clear..

Prasad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic