A Tag can call its Parent Tag
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
Get Head First Servlets and JSP, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.