1 16 package org.apache.taglibs.utility.basic; 17 18 import javax.servlet.jsp.*; 19 import javax.servlet.jsp.tagext.*; 20 21 30 31 public class MacroCopy extends BodyTagSupport { 32 33 private String name; 34 35 public String getName() { 36 return name; 37 } 38 39 public void setName(String val) { 40 this.name = val; 41 } 42 43 public int doStartTag() { 44 return EVAL_BODY_TAG; 45 } 46 47 public int doAfterBody() throws JspException { 48 try { 49 pageContext.setAttribute(this.getName(),bodyContent); 50 } catch (Exception ex) { 51 throw new JspException("Could set pageContext attribute"); 52 } 53 return SKIP_BODY; 54 } 55 56 } 57 | Popular Tags |