• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

BodyTagSupport

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends


If aTag extends BodyTagSupport and returns EVAL_BODY_BUFFERED in the doStartTag() method>
What is the output??
1. BODY CONTENT will be returned in the respnse
2.<%= BODY CONTENT %>is returned .
2. the tags' body content is not returned to the response as it will be buffered.

What are the correct options.

shanthi
[ February 16, 2006: Message edited by: shanthisri mocherla ]
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Santhi,

First thing here is the execution of the body of the tag depends on the setting in web.xml.
<tag>
<name>aTag</name>
<tag-class>sampleLib.aTag</tag-class>
<body-content>empty</body-content>
or <body-content>JSP</body-content>
or <body-content>tagdepenent</body-content>

</tag>
1.If the body content is JSP, the container will evaluate the body to "BODY CONTENT" and add it to the buffer( since you are returning EVAL_BODY_BUFFERED) . This will not be available to the response directly unless you are getting the data from buffer and putting it to the out object.
2. If the body content is tagdepenent.The total expression [<%="BODY CONTENT " %>] will be added to the buffer. you have to get that from the buffer and use in the tag handler calss.

In both of the cases, the data will be there in the buffer.It will not be directly available to the response.

That is only because of the return type EVAL_BODY_BUFFERED.

If the return type is EVAL_BODY_INCLUDE, the body will be directly available to response.

So, I think the last one is the answere.

Thanks,
Chittaranjan
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
Chittaranjan for your explantion.
thanks Shanthi
 
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic