1 13 package info.magnolia.cms.taglibs; 14 15 import javax.servlet.jsp.PageContext ; 16 import javax.servlet.jsp.tagext.TagSupport ; 17 18 19 24 public class IfLastContentNode extends TagSupport { 25 26 29 private static final long serialVersionUID = 222L; 30 31 34 public int doStartTag() { 35 int size = ((Integer ) pageContext.getAttribute(ContentNodeIterator.SIZE, PageContext.REQUEST_SCOPE)).intValue(); 36 int currentIndex = ((Integer ) pageContext.getAttribute( 37 ContentNodeIterator.CURRENT_INDEX, 38 PageContext.REQUEST_SCOPE)).intValue(); 39 if (currentIndex == (size - 1)) { 40 return EVAL_BODY_INCLUDE; 41 } 42 return SKIP_BODY; 43 } 44 45 48 public int doEndTag() { 49 return EVAL_PAGE; 50 } 51 } 52 | Popular Tags |