Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes can someone explain me the output for the code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "can someone explain me the output for the code" Watch "can someone explain me the output for the code" New topic
Author

can someone explain me the output for the code

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
public class body extends BodyTagSupport {
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?
<prefix:sufix>
<i>Hello</i>
</prefix:sufix>
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Hint:
The default doStartTag() returns EVAL_BODY_BUFFERED.
- satya


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
since there is skip_body in doAfterBody
only "how are u" will be printed .
am I correct
[ March 28, 2002: Message edited by: shan java ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
please explain me the output...
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
prints nothing....
tony lee
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
The default doStartTag() returns EVAL_BODY_BUFFERED.

I tried by adding a doStartTag() which returns EVAL_BODY_INCLUDE, then it print "Hello how are you." We can find the return value matters.
What does EVAL_BODY_BUFFERED mean


SCJP2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can someone explain me the output for the code
 
Similar Threads
Exam question.
Simple tags.
Eduardo Cobian's SCWCD Test Q25
printing from doAfterBody in tag handler
Mock test question