• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tag.setParent() method

 
Andrew Rigsby
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For simple tags implementing the SimpleTag interface, the setParent() method is only called when a tag has an enclosing parent.

Is this also the case for classic tags? In other words, is the Tag.setParent() method only called when a tag has an enclosing parent or is the method always called?

Cheers!!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what the specs says :

Classic tags :
The JSP page implementation object invokes setPageContext and setParent, in
that order, before invoking doStartTag() or doEndTag().

Simple tags:
The setJspContext() and setParent() methods are invoked on the tag handler. The setParent() method need not be called if the value being passed in is null.
 
Boobalan Jegathesan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

for Simple custom tag model following method sequences might be called by the JSP container,

setJspContext, setParent, doTag

for classic custom model,

setPageContext, setParent, doStartTag,doEndTag

So these are the container call back methods.

I think setParent() method will be bypassed if this tag doesn�t have a custom action for a parent.

correct me If I am wrong.
 
I have always wanted to have a neighbor just like you - Fred Rogers. 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!