1 13 package info.magnolia.cms.taglibs; 14 15 import javax.servlet.jsp.JspException ; 16 import javax.servlet.jsp.tagext.TagSupport ; 17 18 19 23 public class Attribute extends TagSupport { 24 25 28 private static final long serialVersionUID = 222L; 29 30 33 private Object value; 34 35 38 private String name; 39 40 43 public void setName(String name) { 44 this.name = name; 45 } 46 47 50 public void setValue(Object value) { 51 this.value = value; 52 } 53 54 57 public int doEndTag() throws JspException { 58 Include parent = (Include) findAncestorWithClass(this, Include.class); 59 if (parent == null) { 60 throw new JspException ("nesting error"); } 62 parent.setAttribute(this.name, this.value); 63 return EVAL_PAGE; 64 } 65 66 69 public void release() { 70 this.name = null; 71 this.value = null; 72 super.release(); 73 } 74 } 75 | Popular Tags |