Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

removeAttribute doubt from mock exam

 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Definitely not C. Why did you choose B ? What about A ?
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry chris ,I chosen actually A and mistakenly typed B.

thanks for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic