• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classic , Simple Tags : getParent()

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFSJ P -540 & P-567
simpleTag -> Simple Tag Model
complexTag -> Classic Tag Model

Both tags are declared to be non-empty and non-tag-dependent..

<my:simpleTag>
<my:complexTag/>
</my:simpleTag>

Complex tag can have simple tag as their parents.. (P-540)
but using getParent(), a classic tag can access Classic tag parents. What about Simple Tag parents?

Can't they be accessed using getParent() of classic tag ?
 
Neeraj Singhal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sandeep

In the case of Classic tag having Simple tag parent, we cannot simply call getParent() on classic tag since it can only return Tag type and Simple tag is of type JspTag.

To overcome this situation, Simple tag can be wrapped in TagAdapter class, which provides a way for collaboration between classic Tag handlers and SimpleTag handlers.

See this : TagAdapter Class

Thanks
Neeraj Singhal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic