Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TLD custom tag reference problem

Wesley Baker
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