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