1 package org.apache.turbine.services.jsp.tags; 2 3 18 19 import javax.servlet.jsp.JspException ; 20 import javax.servlet.jsp.PageContext ; 21 import javax.servlet.jsp.tagext.TagSupport ; 22 23 38 public class BodyTag extends TagSupport 39 { 40 static final String ATTRIBUTES = "_body_tag_attributes_"; 41 42 46 private String attributes; 47 48 52 public void setAttributes(String attributes) 53 { 54 pageContext.setAttribute(ATTRIBUTES, attributes, 55 PageContext.REQUEST_SCOPE); 56 this.attributes = attributes; 57 } 58 59 67 public int doStartTag() throws JspException 68 { 69 boolean isActive = ScreenTag.BODY.equals( 70 pageContext.getAttribute(ScreenTag.SECTION_KEY, 71 PageContext.REQUEST_SCOPE) ); 72 if (isActive) 73 { 74 return EVAL_BODY_INCLUDE; 75 } 76 return SKIP_BODY; 77 } 78 79 84 public int doEndTag() throws JspException 85 { 86 return EVAL_PAGE; 87 } 88 } 89 | Popular Tags |