Problem with Classic Custom Tag | Community
Skip to main content
New Participant
October 16, 2015
Solved

Problem with Classic Custom Tag

  • October 16, 2015
  • 1 reply
  • 674 views

I'm trying to create a very basic custom tag that behaves like a c:if tag but with a built-in condition. The problem is that when I try to load a page that uses this custom tag, I get a NoSuchMethodError when it tries to call setJspContext(). As far as I understand, that only applies to simple tags (i.e. classes that extend SimpleTagSupport). However, as you can see, I extend TagSupport because I need the JSP body-content type. I'm hoping someone might be able to spot a problem in what I've done or shed some light on the situation. All code and stack traces are in the gist linked in the first sentence above. Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by hosier_david

In probably the fastest "solve your own question after hours of banging your head and finally posting a forum question" ever, I've resolved this. I failed to mention that I had originally made my tag extend SimpleTagSupport before I realized I couldn't do that and get the behavior I wanted. I hadn't done anything else to trigger a re-compilation of the page JSP. Simply deleting that as referenced HERE and restarting my server fixed the problem.

1 reply

hosier_davidAuthorAccepted solution
New Participant
October 16, 2015

In probably the fastest "solve your own question after hours of banging your head and finally posting a forum question" ever, I've resolved this. I failed to mention that I had originally made my tag extend SimpleTagSupport before I realized I couldn't do that and get the behavior I wanted. I hadn't done anything else to trigger a re-compilation of the page JSP. Simply deleting that as referenced HERE and restarting my server fixed the problem.