wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFS&JSP confusion... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFS&JSP confusion..." Watch "HFS&JSP confusion..." New topic
Author

HFS&JSP confusion...

Jezreel Canav
Greenhorn

Joined: Jul 22, 2004
Posts: 20
i'm confused... what's the truth about tag attributes... they are just in the tag scope or also in the page-scope?

pag 494, BANG section, says-...

All tag attributes have tag scope. That`s right, just the tag. Once the tag is closed, the tag attributtes go out of scope...

pag 567, question 18, says ...

Which are true abou the tag file model?
And one of the correct anwers is...

For each attribue declared and specified in a tag file, the container creates a page-scoped attribute with the same name

that's contradictory for me, can anybody help me please?
taty gora
Greenhorn

Joined: Nov 29, 2004
Posts: 16
I also looked into it.

I think, while tag attributes have tag scope,
they are placed in page scope level.

T
Peter Du
Greenhorn

Joined: Oct 29, 2004
Posts: 14
Please check "JSP.8.3 Semantics of Tag Files" in JSP 2.0 specification, I think when they say TAG scope they really mean it in the JSP page that invoking the tag, but when they say PAGE scope they mean the page for the Tag File. That's what I understand. Can anyone confirm if I understand it right.


Peter Du<br /> <br />SCJP1.4 SCWCD1.4 SCBCD1.3
Gabriel Forro
Ranch Hand

Joined: Apr 16, 2004
Posts: 59
Hi,

here is the explanation from the JSP 2.0 spec (page 174):

The tag file implementation must create and maintain a second instance of
JspContext called a JSP Context Wrapper. If the Invoking JSP Context is an
instance of PageContext, the JSP Context Wrapper must also be an instance of
PageContext. This wrapper must be returned when getJspContext() is called.

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.

...so there is a new JspContext (PageContext) for the tag file.


Gabriel
Jezreel Canav
Greenhorn

Joined: Jul 22, 2004
Posts: 20
ok, thank you very much, but then... can i use tag attributes out of the tag file?, let's say in the including page?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFS&JSP confusion...
 
Similar Threads
Page-scope vs tag-scope
HFS page 567, question 18
HF mistakes in Book?
Attributes in Tag Files: 'Tag' scope or Page scope?
HFSJ errata confusion