Which allows the tl:taskList tag to get the task names from its nested tl:task children?

The tl:taskList and tl:task tags output a set of tasks to the response and are used as follows:
11. <tl:taskList>
12. <tl:task name=”Mow the lawn” />
13. <tl:task name=”Feed the dog” />
14. <tl:task name=”Do the laundry” />
15. </tl:taskList>
The tl:task tag supplies information about a single task while the tl:taskList tag does the final
output. The tag handler for tl:taskList is TaskListTag. The tag handler for tl:task is TaskTag. Both
tag handlers extend BodyTagSupport.
Which allows the tl:taskList tag to get the task names from its nested tl:task children?

The tl:taskList and tl:task tags output a set of tasks to the response and are used as follows:
11. <tl:taskList>
12. <tl:task name=”Mow the lawn” />
13. <tl:task name=”Feed the dog” />
14. <tl:task name=”Do the laundry” />
15. </tl:taskList>
The tl:task tag supplies information about a single task while the tl:taskList tag does the final
output. The tag handler for tl:taskList is TaskListTag. The tag handler for tl:task is TaskTag. Both
tag handlers extend BodyTagSupport.
Which allows the tl:taskList tag to get the task names from its nested tl:task children?

A.
It is impossible for a tag handler that extends BodyTagSupport to communicate with its parent
and child tags.

B.
In the TaskListTag.doStartTag method, call super.getChildTags() and iterate through the
results. Cast each result to a TaskTag and call getName().

C.
In the TaskListTag.doStartTag method, call getChildTags() on the PageContext and iterate
through the results. Cast each result to a TaskTag and call getName().

D.
Create an addTaskName method in TaskListTag. Have the TaskListTag.doStartTag method,
return BodyTag.EVAL_BODY_BUFFERED. In the TaskTag.doStartTag method, call
super.getParent(), cast it to a TaskListTag, and call addTaskName().

E.
Create an addTaskName method in TaskListTag. Have the TaskListTag.doStartTag method,
return BodyTag.EVAL_BODY_BUFFERED. In the TaskTag.doStartTag method, call
findAncestorWithClass() on the PageContext, passing TaskListTag as the class to find. Cast the
result to TaskListTag and call addTaskName().

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *