The sl:shoppingList and sl:item tags output a shopping list to the response and are used as
follows:
11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is
ItemSimpleTag.
ShoppingListTag extends BodyTagSupport and ItemSimpleTag extends SimpleTagSupport.
Which is true?
Answer(s)
- ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() andcasting the result to ShoppingListTag.
- ShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren()and casting each to an ItemSimpleTag.
- It is impossible for ItemSimpleTag and ShoppingListTag to find each other in a tag hierarchybecause one is a Simple tag and the other is a Classic tag.
- ShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() onthe PageContext and casting each to an ItemSimpleTag.
- ItemSimpleTag can find the enclosing instance of ShoppingListTag by callingfindAncestorWithClass() on the PageContext and casting the result to ShoppingListTag.
Correct Answer ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() andcasting the result to ShoppingListTag.