wood burning stoves
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL Question" Watch "EL Question" New topic

EL Question

deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124

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

am i right??
Amruth Puppala
Ranch Hand

Joined: Jul 14, 2008
Posts: 295
Container will find wether this account is Attrbute or bean or map otherwise throws Exception. then try to call getPersonalChecking method

SCJP 5 |SCWCD 5| Started thinking about Web Services ?
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
if so what is the answer for this question from HFSJ Mock exam 2

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

getter methods for booleans are not getXXX but isXXX.

[My Blog]
All roads lead to JavaRanch
Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
my take is option C.

what's the official answer?

SCJP 96% | SCWCD 90%| SCJP mock exams | My SCJP blog
deepa raj
Ranch Hand

Joined: Jul 25, 2008
Posts: 124
Answers are A,B,C
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 850
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?


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
I agree. Here's the link: http://aspose.com/file-tools
subject: EL Question
jQuery in Action, 3rd edition