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

Question from Head First book chapter 10

 
Pawan Arora
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Assume that the tag has been properly configured to allow body content.

Which, if inserted at line 12, would cause the JSP code

<mytags:mytag>BodyContent</mytags:mytag> to ouput BodyContent?

A. return SKIP_BODY;

B. return EVAL_BODY_INCLUDE;

C. return EVAL_BODY_BUFFERED;

D. return BODY_CONTENT;


Answer: B

Why not B and C?

Thanks in advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is : Which would cause the JSP code <mytags:mytag>BodyContent</mytags:mytag> to ouput BodyContent?
Returning EVAL_BODY_BUFFERED will not cause it to output the content of the body, it will store it in a buffer, and you will be responsible for outputting its content.

I find this question a bit disturbing, because we could say that the body content is ouput in a buffer, but I think they mean "output in the web browser"...
 
Pawan Arora
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, it's cleared now.
 
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!