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
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: 574

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,

Back to Java , again.
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: 574

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