Originally posted by Edmund Yong:
I have a doubt on Q17 in Chapter 10: Custom Tag Development of HFJS. It says that "Both tags are declared to be non-empty and non-tag dependent in the TLD". From what I've read, the bodies can be: "JSP", "scriptless", "empty" or "tagdependent". Does that mean that the bodies of the simpleTag and complexTag tags can only be either "scriptless" or "JSP"? If they are "JSP", then surely, answers B and D would be correct.
hi there, in the page 472, first paragraph saying "....the body-content element can be one of either
three or
four values, depending on the
type of tag."
from here, we can know that inside
TLD file, we can declare "JSP","scriptless", "empty", and "tagdependent".
example: (page 473)
<taglib...>
....
<uri>random</uri>
<tag>
<name>advice</name>
<tag-class>foo.Looo</tag-clasS>
<body-content>
JSP</body-content>
<attribute>
....
...
</atribute>
</tag>
BUT, inside a
Tag file, you can have only 3 values, which are "scriptless"(the default when you dont declare), "empty", and "tagdependent". THERE IS NO "JSP" FOR TAG FILE.
example
page 498)
<%@ attribute name="fontColor" required=true %>
<%@ tag body-content="tagdependent" %>
...
...
We CANNOT use scrpiting code in the body of a TAG FILE tag !!! see the big words on page 498.
i hope this is clear.
have fun...