• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can someone explain me the output for the code

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint:
The default doStartTag() returns EVAL_BODY_BUFFERED.
- satya
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please explain me the output...
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
prints nothing....
 
tony lee
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic