File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can a parent tag access its child tag's attribute in Simple Tag

 
Tony suankularb
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 432
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Tony.

Modify Menu.java and MenuItem.java as,

Menu.java

and MenuItem.java
 
Tony suankularb
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot , Chinmaya
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic