1 package org.jahia.deprecated.taglibs.container; 2 3 import java.io.IOException ; 4 5 import javax.servlet.jsp.JspWriter ; 6 import javax.servlet.jsp.tagext.BodyContent ; 7 import javax.servlet.jsp.tagext.BodyTagSupport ; 8 9 import org.jahia.utils.JahiaConsole; 10 11 12 18 public abstract class IfContainerPositionTag extends BodyTagSupport { 19 20 public int doAfterBody() { 21 ContainerTag containerTag = (ContainerTag) findAncestorWithClass(this, ContainerTag.class); 23 if ( containerTag == null) { 24 return SKIP_BODY; 25 } 26 if ( containerTag.isDeclarationPass() ) { 27 return SKIP_BODY; 28 } 29 if ( isPositionGood(containerTag) ) { 30 try { 32 BodyContent body = getBodyContent(); 33 JspWriter out = body.getEnclosingWriter(); 34 out.print(body.getString()); 35 } catch (IOException ioe) { 36 JahiaConsole.println("IfFirstContainerTag: doAfterBody ",ioe.toString()); 37 } 38 } 39 return SKIP_BODY; 40 } 41 42 public abstract boolean isPositionGood( ContainerTag containerTag ); 44 45 } 46 | Popular Tags |