Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about BodyContent object...

 
prajakta patil
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
actually i saw one example in book.In that they have created tag handler which extends BodytagSupport.in 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?
thanks.
 
P Chittaranjan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Chittaranjan
 
prajakta patil
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks chittranjan for fast reply,
prajakta.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic