This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Nested Tag example in HFSJ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Nested Tag example in HFSJ" Watch "Nested Tag example in HFSJ" New topic
Author

Nested Tag example in HFSJ

Kevin Chapple
Greenhorn

Joined: Aug 06, 2005
Posts: 11
Hi everyone,

I've been trying to get my head round nested custom tags and have a query about the Nestedtag example in HFSJ.

The code in the tag is




In the JSP



With output

Tag nested Level: 0
Tag nested Level: 1
Tag nested Level: 2



I dont really understand the code and how the out put is generated. I am confused about nested Tags and what order the tag returns output when they are nested.

In this example does the outermost Nested tag print out the ' Tag nested Level:0' first because the getParent() tag returns 'Null'?Then does the first inner tag return the 'Tag nested Level:1' due to get Parent() returning a non null result once which increments the 'nestLevel' by 1? Then the most nested tag incrementing the 'nestLevel' twice due to getParent() being called twice until returning null

I dont understand the flow of actication of the tags in the example and why the output is what it is.

Thanks in advance for taking the time to review my query



 
 
subject: Nested Tag example in HFSJ
 
Similar Threads
nested tag doubt
Doubt on nested tags
Doubt in SimpleTag and ClassicTag Nesting
Is this an error or Im not understanding
getParent() and SimpleTagHandler