public void doTag(XMLOutput output) throws JellyTagException { DynamicTagLibrary library = getTagLibrary(); DynamicTagLibrary owner = library.find(getName()); if (owner == null) { throw new JellyTagException( "Cannot extend " + getName() + ": dynamic tag not defined"); } if (owner == library) { // disallow extension of tags defined within the same tag // library throw new JellyTagException("Cannot extend " + getName() + ": dynamic tag defined locally"); } superScript = owner.getDynamicTag(name); if (superScript == null) { // tag doesn't define a script - disallow this for the moment. throw new JellyTagException("Cannot extend " + getName() + ": tag is not a dynamic tag"); } owner.registerDynamicTag(getName() , getBody()); }