wood burning stoves 2.0*
The moose likes JSP and the fly likes Appending JSP to BodyContent using BodyTagSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Appending JSP to BodyContent using BodyTagSupport" Watch "Appending JSP to BodyContent using BodyTagSupport" New topic
Author

Appending JSP to BodyContent using BodyTagSupport

David Lund
Greenhorn

Joined: Jan 04, 2010
Posts: 1
I'd like to append some jsp within a custom tag that extends BodyTagSupport.

For example:




And a jsp something like:




I am currently getting the following in the html:


(All the code above i've just made up on the fly, so there code be some compliation issues or methods not overriden properly, but you should get the gist of it....)

Is there anyway of getting the content generated in my tag to be re-rendered by the jsp engine rather than being treated as a string? I don't believe there's a simple answer as if my memory serves anything added to bodycontent is treated seperately from the actual tag body and is never passed to the jsp engine... although i can't believe i'm the first person to want to do this, so there must be a way around it...


Thanks


Dave
Khp Virajith
Ranch Hand

Joined: May 01, 2006
Posts: 85
I have the same issue (as above mentioned post). I just found this while searching through the forum before posting a new topic.
Can anyone answer this?

Isn't it possible to write a custom tag code into the bodyContent and get it evaluated?

Thanks.


SCJP, SCWCD, SCMAD, SCSNI
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1627
    
  23

Hi David,

Can you show me your TLD entry?

Regards,
Frits
Khp Virajith
Ranch Hand

Joined: May 01, 2006
Posts: 85
Hi,

Thanks for replying. By the way, I'm not David, but I just took this thread up, as I have a similar issue.
Please not that I'm using JSP1.2 / Servlets 2.3 (An old system )




Here, I'm listing down my Tag implementation code. For the simplicity, I'm just listing down the method implementation. (Code compiles fine...)



Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1627
    
  23

Hi,

Just try removing the bodyContent code from the doInitBody() method and in the doAfterBody() write to the page by using:


Regards,
Frits
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Appending JSP to BodyContent using BodyTagSupport
 
Similar Threads
Custom Tag with Body (addition of body content)
Exam question.
Can anyone explain this to me?
doAfterBody() is not executed using BodyTagSupport
Tag Handler - how to capture body of a tag???