1 16 17 package org.apache.taglibs.application; 18 19 import java.util.*; 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 44 45 public class SetAttributeTag extends BodyTagSupport 46 { 47 private String name = null; 48 49 54 public final int doStartTag() throws JspException 55 { 56 return EVAL_BODY_TAG; 57 } 58 59 65 public final int doAfterBody() throws JspException 66 { 67 BodyContent body = getBodyContent(); 69 String s = body.getString(); 70 body.clearBody(); 73 pageContext.getServletContext().setAttribute(name,(Object )s); 75 return SKIP_BODY; 76 } 77 78 83 public final void setName(String str) 84 { 85 name = str; 86 } 87 88 } 89 | Popular Tags |