Forums Register Login

How to get tag body using Simple Tags?

+Pie Number of slices to send: Send
HFS&JSP says that if you want to access to actual content of tag body pass
Writer to invoke()
getJspBody().invoke(java.io.Writer)
But i am not able to understand how to code it
Please help me
Thanks.
+Pie Number of slices to send: Send
public class MySimpleTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
StringWriter sw = new StringWriter();
getJspBody().invoke(sw);
getJspContex().getOut().write(sw.toString());
}
}


This is given under this

http://java.boot.by/wcd-guide/ch10s04.html
Please check.I have not tried it out
+Pie Number of slices to send: Send
Thanks
yes it works.
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 486 times.
Similar Threads
classic Tags
Custom if then else tags?
default value of body-content
How to Write This Tag Handler
Writing My Tag Handler by SimpleTagSupport
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 23:26:23.