1 16 17 package org.apache.taglibs.session; 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; 49 50 55 public final int doStartTag() throws JspException 56 { 57 return EVAL_BODY_TAG; 58 } 59 60 66 public final int doAfterBody() throws JspException 67 { 68 BodyContent body = getBodyContent(); 70 String s = body.getString(); 71 body.clearBody(); 74 pageContext.getSession().setAttribute(name,(Object )s); 76 return SKIP_BODY; 77 } 78 79 84 public final void setName(String str) 85 { 86 name = str; 87 } 88 89 } 90 | Popular Tags |