Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

info on BodyTagSupport

 
Abhishek Pratap
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,

i need clarification on ques9 page 553 of HFSJ.

public class BufTag extends BodyTagSupport{
public int doStartTag() throws JspException{
//insert code here
}
}

Assume that the tag is properly configured to allow the body content. which , if inserted at commented line would cause the JSP code <myTags:mytag>BodyContent</myTags:mytag> to output BodyContent

Answer is B. EVAL_BODY_INCLUDE

why not EVAL_BODY_INCLUDE and EVAL_BODY_BUFFERED??
 
Abhishek Pratap
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody reply....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Returning EVAL_BODY_BUFFERED will make everything go to a buffer. So unless you output the buffer itself, nothing will be printed. You could also try to make two tags and see how they differ. One returning EVAL_BODY_INCLUDE, and one returning EVAL_BODY_BUFFERED.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!