This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TLD custom tag reference problem  RSS feed

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been using TLDs and custom tags for a while now with a lot of success. However, i seem to have come across something I'm not sure how to deal with.

I have a class with a static method:

I have a TLD which references this static method:

And finally I have the JSP which calls the TLD:

Here's the problem - if I make Dog a subclass and move the getPaper() static method to the superclass, the JSP will no longer recognize getPaper() as an available method. I can easily get around this by making a getPaper() method for every subclass instead, but that's not very OO. Am I violating some core Java principle here? Why doesn't this work?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!