Hi,
Question 9 from Head First 1.4 version of mock exam chapter 10 (Custom tag development)
public class BufTag extends BodyTagSupport {
public int doStartTag() throws JspException {
//insert code here
}
}
Assume, that the tag has been properly configured to allow body content.
Which, if inserted at line 12, would cause the
JSP code
<mytags:mytag>BodyContent</mytags:mytag> to output
BodyContent
The answer given by them is : return EVAL_BODY_INCLUDE;
I know that will give the desired output.. But what about return EVAL_BODY_BUFFERED?
It will call the setBodyContent(BodyContent b). then it will cal doInitBody(), and then it will call EVAL_BODY_INCLUDE ( as per the diagram given on page 533). My tiinking is that the diagram is misleading.. I saw the function doInitBody() and there is no code in that method. It means there is no action. So might be the diagram on pg 533 is wrong.
Also I see they have mentioned to refer (JSP v2.0 pg 2-68).. What does this mean? Are they asking to refer JSP Spec 2.0.. What does pg 2-68 means?
Regards
Prem Kashyap