Hi, I'm reading "Head First Servlets and JSP" and have a question concerning page-scope vs tag-scope. I'm having trouble with one of the Mock Exam questions:
Chapter 10 Mock Exam, answer to question 18, p.599:
"Which are true about the Tag File model?"
One of the answers is:
"For each attribute declared and specified in a Tag File, the container creates a page-scoped attribute with the same name."
Shouldn't it read "creates a tag-scoped attribute"? A page-scoped attribute would be visible outside of the tag, wouldn't it? For example:
The JSP:
The generated page:
This isn't what really happens--what happens is it can't find ${foo}, so it prints an empty string. But isn't this what should happen if tag attributes are page-scoped? Thanks!
Chapter 10 Mock Exam, answer to question 18, p.599:
"Which are true about the Tag File model?"
One of the answers is:
"For each attribute declared and specified in a Tag File, the container creates a page-scoped attribute with the same name."
Shouldn't it read "creates a tag-scoped attribute"? A page-scoped attribute would be visible outside of the tag, wouldn't it? For example:
The JSP:
The generated page:
This isn't what really happens--what happens is it can't find ${foo}, so it prints an empty string. But isn't this what should happen if tag attributes are page-scoped? Thanks!