Simple tags can have Classic parents
This is not a problem, because a SimpleTag’s getParent() returns type JspTag, and Classic tags and Simple tags now share the JspTag super interface. Actually, Classic tags can have Simple parents, but it takes a slight hack to make that work because you can’t cast a SimpleTag to the Tag return value of the Tag interface getParent(). We won’t go into how to access a Simple tag parent from a Classic child tag[10], but all you need to know for the exam (and almost certainly real web app life) is that by using getParent(), a Classic tag can access Classic tag parents, and a Simple tag can access either a Classic or Simple parent.

Using the getParent() method, a Classic tag can access Classic tag parents, and a Simple tag can access either a Classic or Simple parent.
In a JSP

In the SimpleInner tag handler

In the ClassicParent tag handler

[10] If you’re really curious, look at the TagAdapter class in the J2EE 1.4 API.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access