GeeCON Prague 2014*
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


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
 
 
subject: can someone explain me the output for the code