Given a tag handler defined with <bodycontent>
JSP</bodycontent> which implements TagSupport and ONLY overrides doAfterBody with the following lines:
public int doAfterBody() throws JspException {
try { pageContext.getOut().print(� how are you? �);}catch(IOException e) {}
return SKIP_BODY;
}
What will be the result of a jsp with the following part?
<prefix:sufix>
<i>Hello</i>
</prefix:sufix>
1) The jsp page will print: Hello
2) The jsp page will print: Hello how are you?
3) The jsp page will print: how are you? Hello
4) The jsp won't print anything.
The answer is :
4) The jsp won't print anything.
TagSupport.doStartTag by default returns SKIP_BODY and as it is not overriden the body is ignored.
As I remembered that TagSupport doesn't
have doAfterBody, we have to implement
BodyTagSupport... please correct me if
I am wrong.
And what is the different between
JSP 1.1 & JSP 1.2 ?
It seems like I studied JSP 1.1 a lot,
and there are some big different..
Thx..