O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

image with no caption

A nested tag can access its parent (enclosing) tag

image with no caption

Getting the parent tag in a Classic tag handler

image with no caption

Getting the parent tag in a Simple tag handler

image with no caption

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required