Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing Tag Body in Classic Tag

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I access the tag body in a classic tag. I have tried :-

BodyContent bc=getBodyContent();
System.out.println("Body Content1 :- "+bc);


and also


System.out.println("Body Content1 :- "+bodyContent);


inside the doStartTag() and doEndTag(). But in both cases it returns null . My tag extends BodyTagSupport. Do I have to implement any other method ???
 
Paul Croarkin
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try:

BodyContent body = getBodyContent();
JspWriter out = body.getEnclosingWriter();
out.print(body.getString());
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic