• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

findAncestorWithClass

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method TagSupport.findAncestorWithClass() can be used...

The answer to this is Any type of tag (Tag, IterationTag, BodyTag)

But I thought the answer will be only for tags extending Tag Support.
The hint they have given is as follows




Remember these two points
#1. Any type of tag (Tag, IterationTag, BodyTag) can be nested within another.
#2. The method findAncestorWithClass() is a static method defined in TagSupport class provided for convenience:
public static final Tag findAncestorWithClass(Tag from, java.lang.Class klass);

Thus, it is not necessary to implement the BodyTag interface or extend from the TagSupport or the BodyTagSupport classes to use this method.
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic