Forums Register Login

Why is custom tag not producing any output?

+Pie Number of slices to send: Send
Hi,

I have created a custom tag. The code follows. Despite the fact that I verified through log statements that the doAfterBody is called and returns a value, nothing is output to my JSP page. Any ideas for troubleshooting further?

Java class ...


JSP invocation:


TLD:


Thanks, - Dave
+Pie Number of slices to send: Send
Why aren't you basing your tag on SimpleTagSupport rather than "classic" BodyTagSupport.


(where "classic" means "we didn't deprecate it, but it's just too complex and cantankerous to deal with, so we completely replaced it with something else").
+Pie Number of slices to send: Send
SimpleTagSupport doesn't support custom tags that have JSP body-content. I am open to another implementation but the question is still unanswered.

- Dave
+Pie Number of slices to send: Send
But it does support "scriptless" bodies--isn't that good enough?
+Pie Number of slices to send: Send
Hi Dave,

Why are you overriding the setBodyContent() method, this is not needed. Furthermore the body content is usually written to the page like this:

Regards,
Frits
+Pie Number of slices to send: Send
To David's question,

I can't guarantee that the body-content will not contain EL expressions. However, even when it contains text (per the example in the original post)å



I'm getting the error that follows ...




The new code I have is

+Pie Number of slices to send: Send
Well, yeah; you'd have to change the TLD to be "scriptless", not JSP. But I think one or both of us is missing something--that doesn't mean the body can't contain EL or JSP:TLD (probably screwed up--more or less from memory and crappy examples on web)Tag implOutput
+Pie Number of slices to send: Send
In any case--why not use JSP 2.0 JSP-based tags? For something as simple as this that isn't really doing much it sure seems easier.
+Pie Number of slices to send: Send
You can lead the horse to water ...
+Pie Number of slices to send: Send
David, Per your suggestion (thanks for the helpful example), I changed the body-content to "scriptless" instead of "JSP" and everything worked.

I actually don't know anything about JSP 2.0 tags so didn't know to ask about them. I will see how they can be used with reference to my example.

Thanks, -
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1707 times.
Similar Threads
displat:table tag pls help me
Custom Tags - Repeating Tags
Custom JSP Tag - Unrequired-Fields not cleared
Problem while Tag lib Up gradation
Jsp Custom Tag
More...

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