• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tag.setParent() method

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic