It's not a secret anymore!
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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "removeAttribute doubt from mock exam" Watch "removeAttribute doubt from mock exam" New topic
Author

removeAttribute doubt from mock exam

Bobby Sharma
Ranch Hand

Joined: Mar 18, 2008
Posts: 596
    
    1

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,
omi


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é
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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
    
    1

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

thanks for your reply.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: removeAttribute doubt from mock exam
 
It's not a secret anymore!