I have written a custom tag, by implementing BodyTag and Serializable. The doStartTag always returns EVAL_BODY_INCLUDE.
According to
JSP 1.2 API, the BodyTag interface, the doInitBody() method:
Prepare for evaluation of the body. This method is invoked by the JSP page implementation object after setBodyContent and before the first time the body is to be evaluated. This method will not be invoked for empty tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
In spite of this, the doInitBody() method is invoked.
Has anyone else encountered this behaviour (
tomcat 4.0.1)?
Does anyone else think the taglib api and design is more complex than it need be? I used ATG Dynamo for some time and they implemented the "Droplet" system whereby custom tags were esentially implemented mini
servlets. One of the key benefits was that you could pass chunks of dynamic content as parameters - and choose to output them or not. This would be equivalent to having multiple bodies in a custom tag. I can tell you it was a lot simpler than this rigmarole!
Regards
James