• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

EL Question

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



container will check an find the account attribute and it will try to call
getPersonalChecking method.

am i right??
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Container will find wether this account is Attrbute or bean or map otherwise throws Exception. then try to call getPersonalChecking method
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if so what is the answer for this question from HFSJ Mock exam 2


 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getter methods for booleans are not getXXX but isXXX.
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my take is option C.

what's the official answer?
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answers are A,B,C
 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A. <c:if test='${account.personalChecking}'>Checkingthat fits your lifestyle.</c:if>B. <c:if test='${account["personalChecking"]}'>Checkingthat fits your lifestyle.</c:if>C. <c:if test="${account[�personalChecking']}">Checkingthat fits your lifestyle.</c:if>D. <c:if test='${account.isPersonalChecking}'>Checkingthat fits your lifestyle.</c:if>



Here we can't use the D option because in EL you can never invoke a method(isPersonalChecking) on the object(account).

In EL you can always access the property of a object.

As this method name is following the name convention... isXXX

So here PersonalChecking turns out to be a property.

So in the first three options, its trying to access the bean or object(account) property(PersonalChecking).

Makes Sense?

Cheers...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!