Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFS Mock Exam Ch 10 Q 18

 
Bart Allen
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 494 it states that "All tag attributes have TAG scope."

The answer for question 18 indicates that F, which reads:

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

is a correct answer.

Do these two statements contradict each other, or is the "answer" provided in addition to the tag attribute, for which I must have must have missed reading somehow?
 
Roger Yates
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bart,

I just checked the JSP spec (part 1, pages 173-175) which basically says (my summary):
When a tag is executed, the context is copied, and any tag attributes are given PAGE scope. Any PAGE-related changes occur only to the copied context. Any changes of wider scope than PAGE must be replicated back to the original context.
i.e. the attributes have PAGE scope, but you will only ever have access to them from within the TAG. I think the phrase "TAG scope" was Bryan/Kathy/Bert's way of getting this idea across more succinctly.


Here's an extract from the spec:
For each invocation to the tag, the JSP Context Wrapper must present a clean page scope containing no initial elements. All scopes other than the page scope must be identical to those in the Invoking JSP Context and must be modified accordingly when updates are made to those scopes in the JSP Context Wrapper. Any modifications to the page scope, however, must not affect the Invoking JSP Context.

[ October 13, 2004: Message edited by: Roger Yates ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic