tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Bonevich <bonev...@telocity.com>
Subject How to mess with BodyContent prior to evaluation
Date Mon, 08 Apr 2002 04:15:24 GMT
Here is what I want to do:
* I have a taglib with a tag:
   <mytag:get value="value_name" [parse="(true|false)"]/>
* the GetTag class extends BodyTagSupport
* doStartTag returns EVAL_BODY_BUFFERED
* doInitBody() needs to get the object/value associated with value 
attribute; so I lookup "value_name" in a repository object I shoved in 
my PageContext early on...
* then I want to potentially parse the value (rendered as a string of 
course) as JSP; otherwise I just print out the value via 
pageContext.getOut().print(value.toString())

The latter part is simple enough to do, but there seems to be no way to 
grab the contents of the BodyContent, muck with those contents, and then 
stuff them back in and have them evaluated as JSP.  Thought I might be 
able to do this in doInitBody (as the spec sez that BodyContent has not 
been evaluated yet at this point), but I can determine no 
straightforward (i.e. no implementation-specific) way to do this.

Anyone have suggestions?  Need more to go on (I can provide code if that 
helps)?

jeff

-- 
Jeffrey Bonevich
Ann Arbor, Michigan
bonevich@telocity.com
http://www.bonevich.com

Hwæt! Wë Gär-Dena   in geär-dagum,
peod-cyninga,       prym gefrünon,
hü ða aepelingas   ellen fremedon!


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message