Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Problem with Classic Custom Tag

hosier_david
Level 2
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
hosier_david
Correct answer by
Level 2
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

0 Replies
hosier_david
Correct answer by
Level 2
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