This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!