• Post Reply Bookmark Topic Watch Topic
  • New Topic

confused with getJspBody() method

 
geeta vemula
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is from page 522 HFSJ (second edition) about JspFragment,

In that is it stated we dont have method to get the body contents of the tag like getBody or getContents. But in the previous page(520) in doTag() they have used getJspBody().invoke(null) to evaluate the body.. so can't we get bodycontents with getJspBody() itself?

Thanks,
Geeta
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi geeta
getJspBodu() returns JSP fragment and invoke is called on jspfragment instance. so there are no direct methods in doTag to access body without calling invoke method on sp fragment. however we can get JspFragment using getJspBody()
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!