Page 1 of 1

a question about Tag Files in HFSJ (2nd ed)

Posted: Mon Jun 23, 2014 12:33 am
by icepeanuts
I found a question about Tag Files in Head First Servlets and JSP (2nd edition).

Given a tag, simpleTag, whose handler is implemented using the Simple tag model
and a tag, complexTag, whose handler is implemented using the Classic tag model.
Both tags are declared to be non-empty and non-tag dependent in the TLD.
Which JSP code snippets are valid uses of these tag?

A. <my:simpleTag>
<my:complexTag />
</my:simpleTag>

The answer says this option is correct. But I don't think it is correct because "Both tags are declared to be non-empty and non-tag dependent in the TLD". It is obvious that the my:complexTag is invoked without a body. Am I right?

Re: a question about Tag Files in HFSJ (2nd ed)

Posted: Mon Jun 23, 2014 1:18 am
by admin
Non-empty doesn't mean you have to have something in the body. It can be empty as well.
But did you check with the authors? What did they say?

thank you,
Paul.