| Author |
How can a parent tag access its child tag's attribute in Simple Tag
|
Tony suankularb
Greenhorn
Joined: Aug 10, 2009
Posts: 19
|
|
I know only how parent tag access its child tag's attribute in Classic Tag
Source code from HFSJ
JSP
child tag: MenuItem
In the parent tag: Menu
As far as I understand, the body content is evaluated between doStartTag() and doEndTag().
So, doEndTag() can access its child's attribute.
But, what about Simple Handler Class which has only doTag() method
How can we know the child's attribute is available for the parent. I means in the simple tag, when the body content is evaluated.
All I know is getJspBody().invoke(writer); of Simple Tag can write the body to a writer
|
 |
Chinmaya Chowdary
Ranch Hand
Joined: Apr 21, 2008
Posts: 432
|
|
Hi, Tony.
Modify Menu.java and MenuItem.java as,
Menu.java
and MenuItem.java
|
 |
Tony suankularb
Greenhorn
Joined: Aug 10, 2009
Posts: 19
|
|
Thanks a lot , Chinmaya
|
 |
 |
|
|
subject: How can a parent tag access its child tag's attribute in Simple Tag
|
|
|