if (this.value != null) { EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class); if (tag == null) { throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
if (this.value != null) { EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class); if (tag == null) { throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
/** * Find parent tag which must implement AttributeContainer. * @throws JspException If we can't find an appropriate enclosing tag. */ protected PutTagParent findEnclosingPutTagParent() throws JspException { try { PutTagParent parent = (PutTagParent) findAncestorWithClass(this, PutTagParent.class); if (parent == null) { throw new JspException("Error - tag put : enclosing tag doesn't accept 'put' tag."); } return parent; } catch (ClassCastException ex) { throw new JspException("Error - tag put : enclosing tag doesn't accept 'put' tag."); } }
/** * Find enclosing parent tag accepting this tag. * @throws JspException If we can't find an appropriate enclosing tag. */ protected PutListTagParent findEnclosingParent() throws JspException { try { PutListTagParent parent = (PutListTagParent) findAncestorWithClass(this, PutListTagParent.class); if (parent == null) { throw new JspException("Error - tag putList : enclosing tag doesn't accept 'putList' tag."); } return parent; } catch (ClassCastException ex) { throw new JspException("Error - tag putList : enclosing tag doesn't accept 'putList' tag."); } }
/** * Find parent tag which must implement AttributeContainer. * @throws JspException If we can't find an appropriate enclosing tag. */ protected AddTagParent findEnclosingPutListTagParent() throws JspException { try { AddTagParent parent = (AddTagParent)findAncestorWithClass(this,AddTagParent.class); if( parent == null ) { throw new JspException( "Error - tag add : enclosing tag doesn't accept 'add' tag." ); } return parent; } catch( ClassCastException ex ) { throw new JspException( "Error - tag add : enclosing tag doesn't accept 'add' tag." ); } } }
public static Node getContext(Tag t) throws JspTagException { ForEachTag xt = (ForEachTag) TagSupport.findAncestorWithClass( t, ForEachTag.class); if (xt == null) return null; else return (xt.getContext()); }
public static Node getContext(Tag t) throws JspTagException { ForEachTag xt = (ForEachTag) TagSupport.findAncestorWithClass( t, ForEachTag.class); if (xt == null) return null; else return (xt.getContext()); }
public static Node getContext(Tag t) throws JspTagException { ForEachTag xt = (ForEachTag) TagSupport.findAncestorWithClass( t, ForEachTag.class); if (xt == null) return null; else return (xt.getContext()); }
public static Node getContext(Tag t) throws JspTagException { ForEachTag xt = (ForEachTag) TagSupport.findAncestorWithClass( t, ForEachTag.class); if (xt == null) return null; else return (xt.getContext()); }
public static Node getContext(Tag t) throws JspTagException { ForEachTag xt = (ForEachTag) TagSupport.findAncestorWithClass( t, ForEachTag.class); if (xt == null) return null; else return (xt.getContext()); }
/** * Processes the <CODE>param</CODE> tag. * * @return <CODE>SKIP_BODY</CODE> */ @Override public int doStartTag() throws JspException { final ParameterizableTag parameterizableTag = (ParameterizableTag) TagSupport.findAncestorWithClass(this, ParameterizableTag.class); if (parameterizableTag == null) { throw new JspException( "the 'param' Tag must have a parent tag that implements ParameterizableTag"); } if (this.name != null) { parameterizableTag.addParameter(this.name, this.value); } return SKIP_BODY; }
public int doStartTag() throws JspTagException { CacheTag ancestorCacheTag = (CacheTag) TagSupport.findAncestorWithClass(this, CacheTag.class); if (ancestorCacheTag == null) { throw new JspTagException("GroupsTag cannot be used from outside a CacheTag"); } ancestorCacheTag.addGroups(String.valueOf(groups)); return EVAL_BODY_INCLUDE; }
public int doStartTag() throws JspTagException { CacheTag ancestorCacheTag = (CacheTag) TagSupport.findAncestorWithClass(this, CacheTag.class); if (ancestorCacheTag == null) { throw new JspTagException("GroupTag cannot be used from outside a CacheTag"); } ancestorCacheTag.addGroup(String.valueOf(group)); return EVAL_BODY_INCLUDE; }
/** {@inheritDoc} */ @Override protected void execute() throws TilesJspException { PutAttributeTagParent parent = (PutAttributeTagParent) TagSupport.findAncestorWithClass(this, PutAttributeTagParent.class); if (parent == null) { throw new TilesJspException( "Error: no enclosing tag accepts 'putAttribute' tag."); } parent.processNestedTag(this); } }
/** * Executes the processing of this tag, calling its parent tag. * * @throws TilesJspException If something goes wrong during execution. */ protected void execute() throws TilesJspException { AddAttributeTagParent parent = (AddAttributeTagParent) TagSupport.findAncestorWithClass(this, AddAttributeTagParent.class); if (parent == null) { throw new TilesJspException( "Error: no enclosing tag accepts 'addAttribute' tag."); } parent.processNestedTag(this); }
public static Node getContext(Tag t) throws JspTagException { ForEachTag xt = (ForEachTag) TagSupport.findAncestorWithClass( t, ForEachTag.class); if (xt == null) return newEmptyDocument(); else return (xt.getContext()); }
/** {@inheritDoc} */ @Override protected void execute() throws TilesJspException { PutListAttributeTagParent parent = (PutListAttributeTagParent) TagSupport .findAncestorWithClass(this, PutListAttributeTagParent.class); if (parent == null) { // Try with the old method. super.execute(); } parent.processNestedTag(this); } }
/** * The start tag. * * @throws JspTagException The standard tag exception thrown. * @return The standard Tag return. */ public int doStartTag() throws JspTagException { CacheTag cacheTag = (CacheTag) TagSupport.findAncestorWithClass(this, CacheTag.class); if (cacheTag == null) { throw new JspTagException("A UseCached tag must be nested within a Cache tag"); } cacheTag.setUseBody(!use); return SKIP_BODY; } }
public int doAfterBody() throws JspException { LayoutTag tag = (LayoutTag) TagSupport.findAncestorWithClass(this, LayoutTag.class); if (tag == null) { throw new JspException( "Sidebar tag must be in an enclosing Layout tag"); } tag.setSidebar(getBodyContent().getString()); return SKIP_BODY; } }
@Override public int doEndTag() throws JspException { final RenderPortletTag renderPortletTag = (RenderPortletTag) TagSupport.findAncestorWithClass(this, RenderPortletTag.class); if (this.windowState != null) { final WindowState state = PortletUtils.getWindowState(this.windowState); renderPortletTag.setParentUrlState(state); } if (this.portletMode != null) { final PortletMode mode = PortletUtils.getPortletMode(this.portletMode); renderPortletTag.setParentUrlMode(mode); } renderPortletTag.setParentUrlParameters(this.parameters); return EVAL_PAGE; }