File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes removeAttribute doubt from mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "removeAttribute doubt from mock exam" Watch "removeAttribute doubt from mock exam" New topic

removeAttribute doubt from mock exam

Bobby Sharma
Ranch Hand

Joined: Mar 18, 2008
Posts: 596

Here the question :

Given that scoped attribute cart exist only in user's session,which two
taken independently ,ensure that scoped attribute cart no longer exits?

A)<c:remove var="cart"/>
B)<c:remove var="${cart}"/>
C)<c:remove scope="session">cart</c:remove>
D)<c:remove scope="session" var="cart"/>
E)<c:remove scope="session">${cart}</c:remove>
According to mock exam's ,the answer is C and D.And it explains that
removeAttribute default is page scope.So B doest not work and incorrect.

I tested the code and found out the real answer should be B and D.
Because c give compilation error ,declaring that body content is empty.

please explain which answers are correct.

best regards,

Most of the programming problems can't be solved because you don't know what the exact problem is.
Defining your problem correctly leads you to the right solution.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Definitely not C. Why did you choose B ? What about A ?

[My Blog]
All roads lead to JavaRanch
Bobby Sharma
Ranch Hand

Joined: Mar 18, 2008
Posts: 596

sorry chris ,I chosen actually A and mistakenly typed B.

thanks for your reply.
I agree. Here's the link:
subject: removeAttribute doubt from mock exam
It's not a secret anymore!