This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question from Eduardo Cubian'sTest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question from Eduardo Cubian Watch "Question from Eduardo Cubian New topic

Question from Eduardo Cubian'sTest

Terrence White
Ranch Hand

Joined: Jun 26, 2002
Posts: 39
Question from ]

Question 25)
Given the following tag handler defined with <bodycontent>JSP</bodycontent>
public class body extends TagSupport {
public int doStartTag() throws JspException{
public int doAfterBody() throws JspException {
try { pageContext.getOut().print("how are you?"); }catch(IOException e) {}
return SKIP_BODY;
what will be printed out by the following part of a jsp page?
1) The tag handler won't compile.
2) The jsp page will print Hello how are you?
3) The jsp page will print how are you? Hello
4) The jsp page will print Hello

The stated answer is:
4) The jsp page will print Hello
As far as I know you can't print from doAfterBdoy in a TagSupport handlers.

Is this correct?
subject: Question from Eduardo Cubian'sTest
It's not a secret anymore!