Multiple choice technology programming languages

Which returns the enclosing tag when called from within a tag handler class?

  1. getParent()

  2. getAncestor()

  3. findAncestor()

  4. findParent()

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In JSP custom tag handlers, getParent() returns the closest enclosing tag handler. This is part of the Tag and BodyTag interfaces. getAncestor(), findAncestor(), and findParent() are not standard methods in the JSP tag handler API. The getParent() method allows a nested tag to communicate with its parent tag, which is essential for cooperative tag handler patterns.