• 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

BodyContent() doubt

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the JSP 2.0 specification:-

public abstract class BodyContent extends JspWriter

An encapsulation of the evaluation of the body of an action so it is available to a
tag handler. BodyContent is a subclass of JspWriter.
Tag Handlers that want Access to their Body Content


Can anybody Please explain me the what dose it mean to the line in Bold???


Thanks
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It simply means that whatever is there inside the tag body, is evaluated (if EL is present and rtexprvalue is true) and then available to us (indide the doTag method) via BodyContent for further processing of that content. If we dont use BodyContent and pass null to getJspWriter().invoke() method, then the body will be written to the response stream straight away without giving us a chance of processing.

this is particularly useful for Simple Tags where you dont have any specialized methods to access the body directly unlike the Classic tag's BodyTag interface which gives us a complete method where we can get the body and process it.
reply
    Bookmark Topic Watch Topic
  • New Topic