Forums Register Login

doubt (question) on Tag File attribute scopes (Q18 p557)

+Pie Number of slices to send: Send
Hi,
This may be a semantic issue, which is why I can't test it via code.
On page 557, Q18 asks "Which are true about the Tag File model?
Among the correct answers was this one:

F. For each attribute declared and specified in a Tag File, the container creates a page-scoped attribute with the same name.

However, on page 494 (Tag Files) in the box at the bottom is this sentence in BOLD font:
"All tag attributes have TAG scope."

So which is correct? These 2 statements seem to contradict each other.
Should the answer F actually read: "...the container creates a TAG scoped page attribute with the same name"???

Thanks for any help!
DaveS
SCJP
+Pie Number of slices to send: Send
Hi Dave,

See in case of tag files there are two context.
Invoking JSP context and JSP Context Wrapper.
and they are isolated from each other.

So, your unsynchronized page-scoped attributes of the tag-files won't be accessible to your invoking jsp page. But there will be page-scoped attribute with the same name in your tag-file.

And obviously, the scope of tag atrributes is restricted within the tags only unless you don't synchronize them.

Regards,
Khushhal
+Pie Number of slices to send: Send
Thanks khushhal,
Now it makes sense!
DaveS
Ever since I found this suit I've felt strange new needs. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1593 times.
Similar Threads
HFS Mock Exam Ch 10 Q 18
HFS Chapter 10 Q 18 option F pg 567
page 448 Default scope of c:remove
Doubt in HFSJ page-567
HFS page 567, question 18
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:18:20.