• Post Reply Bookmark Topic Watch Topic
  • New Topic

TagSupport.getParent() returns null

 
Himai Minh
Ranch Hand
Posts: 1400
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a classical tag like this:



I got a null pointer exception in from line 19 when I called tag.doStartTag().
Why ?
 
Himai Minh
Ranch Hand
Posts: 1400
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, I figured out why.
I modified the code:


Now, it prints *JSP *insideJSP *
where the doStartTag prints *.
The outer tag does not have a parent. That is why getParent() returns null.
 
I do some of my very best work in water. Like this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!