• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TagSupport.getParent() returns null

 
Himai Minh
Ranch Hand
Posts: 1360
7
  • 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: 1360
7
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic