Forums Register Login

a JSTL question in Whizlabs Exam Simulator

+Pie Number of slices to send: Send
Hi, Here is my question found in Whizlabs Exam Simulator:

Which of the following JSTL fragment will not delete the "empName" attribute from "session" scope? Select one choice.
a. <c:remove name="empName"/>
b. <c:set var="empName" scope="session" value=""/>
c. <c:remove scope="session" name="empName"/>
d. both a and b
e. None of the above

I think the answer is a and c. Because <c:set> syntax is
<c:remove var="varName" [scope="{page|request|session|application}]/>
not <c:remove name="..." ..../>


But when I checked answer, it shows e. Can anybody help me figure it out? Thanks.
+Pie Number of slices to send: Send
The question reads which one will NOT remove enpName from the session scope. A, B, and C will all remove empName.
+Pie Number of slices to send: Send
hi patrick

yeah : i misread the q (didnt see the "not"). but surely

a. <c:remove name="empName"/>

default is page not session scope and "name" should be "var". so a wont remove.


b. <c:set var="empName" scope="session" value=""/>

setting to "" doesnt remove the attribute, does it?


c. <c:remove scope="session" name="empName"/>

invalid : should be var="empName"?

d. both a and b

neither will do it so both wont

e. None of the above

meaning "none of the above will not remove" so that's "all of the above will remove"? odd. but i can't agree with e. either.


my JSTL newbie mind needs enlightenment,


peter
+Pie Number of slices to send: Send
I didn't catch the the var/name error. I agree! Good Catch! If it were var instead of name, they would all remove the empName attribute. A null value on c:set will remove the empName attribute. That information can be found on pg 25 of the JSTL spec (sec 4.3).
+Pie Number of slices to send: Send
Thank you all for replying my question. I passed SCWCD this past Saturday at 84%. From my experience HFSJ is enough for passing the exam. I also did some mock exams from whizlabs simulator (My scores on whizlabs are very close the the real exam).

Thanks,
+Pie Number of slices to send: Send
"java_masker"

I don't know why nobody mentioned this before, but your display name does not meet our naming policy. Please read it, follow the link at the bottom, and change your name to something appropriate.

Thanks!
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 820 times.
Similar Threads
removeAttribute doubt from mock exam
About c:remove
Usage of c:remove tag
Question about JSTL (c:remove)
page 448 jstl doubt
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:37:56.