Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Why is custom tag not producing any output?  RSS feed

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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").
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SimpleTagSupport doesn't support custom tags that have JSP body-content. I am open to another implementation but the question is still unanswered.

- Dave
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But it does support "scriptless" bodies--isn't that good enough?
 
Creator of Enthuware JWS+ V6
Bartender
Posts: 3114
256
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can lead the horse to water ...
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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, -
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!