// Locate the one and only UIViewRoot custom action instance by walking up the tag tree
// until you find a UIComponentELTag instance that has no parent. If the
// getCreated() method of this instance returns true, check the binding attribute.
Tag parent = this;
UIComponentELTag parentTag = null;
while ((parent = parent.getParent()) != null)
{
if (parent instanceof UIComponentELTag)
{
parentTag = (UIComponentELTag)parent;
}
}
if (parentTag == null)
{
throw new JspException("Not nested in a UIViewRoot Error for tag with handler class: "
+ this.getClass().getName());
}
if (!parentTag.getCreated())
{
return SKIP_BODY;
}
UIViewRoot root = (UIViewRoot)parentTag.getComponentInstance();
// JSF-Spec 1.2 9.4.9
// If binding is set, call binding.getValue() to obtain a reference to the
// PhaseListener instance. If there is no exception thrown, and binding.getValue()
// returned a non-null object that implements javax.faces.event.PhaseListener, register