• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

EL Question

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getter methods for booleans are not getXXX but isXXX.
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answers are A,B,C
 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic