File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes about BodyContent object... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "about BodyContent object..." Watch "about BodyContent object..." New topic

about BodyContent object...

prajakta patil
Ranch Hand

Joined: Dec 11, 2005
Posts: 30
actually i saw one example in book.In that they have created tag handler which extends that class they r using directly instance
reference (bodyContent is its name)of Bodycontent class in doEndTag() method without creating it.can anybody explain me how it is possible?is jsp engine creating instance for us?
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
Hi Prajakta,
BodyTagSupport class has the member variable defined as follows.

public class javax.servlet.jsp.tagext.BodyTagSupport extends javax.servlet.jsp.tagext.TagSupport implements javax.servlet.jsp.tagext.BodyTag {
protected javax.servlet.jsp.tagext.BodyContent bodyContent;


So you can use it without declaring it.


Thanks,<br />Chittaranjan<br />SCJP 5.0,SCWCD1.4,SCBCD 5
prajakta patil
Ranch Hand

Joined: Dec 11, 2005
Posts: 30
thanks chittranjan for fast reply,
I agree. Here's the link:
subject: about BodyContent object...
It's not a secret anymore!