• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dave Seligson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Seligson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks khushhal,
Now it makes sense!
DaveS
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic