Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on Classic Tag

 
Narender Ek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

Can any body tell me y the answer is A for the following question:

1.<%@ taglib uri="example" prefix="example"%>
2.<example:aTagWithABody>
3.<%="BODY CONTENT"%>
4.</example:aTagWithABody>
If the aTagWithABody tag extends javax.servlet.jsp.tagext.TagSupport,and answer 1 that tag's handler returns EVAL_BODY_BUFFERED from doStartTag,what is the result of processing the JSP code?

A. Compilation fails.
B. "BODY CONTENT" IS returned in the generated response.
C. "<%=BODY CONTENT%>" is returned in the generated response.
D. Because the tag's body content will be buffered, it will
not be returned in the generated response.

Answer: A
 
rohini gundu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have tried that example on my local machine and its working fine.Also they havent specified what is the <body-content> in the the tld file. If we spcify that <body-content> as jsp then BODYCONTENT is a part of the output.But if we specify that it is tagdependent then that part wont be part of the output. I have tried this on the container which supports only 2.3 servlet specification and 1.2 jsp container specification.

I dont know if it behaves differently on servlet 2.4

Please correct me if i am wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic