Expand my Community achievements bar.

SOLVED

Problem with Classic Custom Tag

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 2

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

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.