Both SimpleTag and Tag have a getParent() method. The getParent() in Tag returns a Tag, but the getParent() in SimpleTag returns an instance of JspTag. We’ll see the implications of those return types in a minute.
A nested tag can access its parent (enclosing) tag
Getting the parent tag in a Classic tag handler
Getting the parent tag in a Simple tag handler