1 16 17 package org.apache.taglibs.regexp; 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 48 49 public class TextTag extends BodyTagSupport 50 { 51 52 57 public final int doStartTag() throws JspException 58 { 59 return EVAL_BODY_TAG; 60 } 61 62 68 public final int doAfterBody() throws JspException 69 { 70 BodyContent body = getBodyContent(); 72 String text = body.getString(); 73 body.clearBody(); 76 77 if( text == null ) 79 throw new JspException( 80 "regexp tag text could not find a text string in body of tag."); 81 82 TextData td = new TextData(text); 83 pageContext.setAttribute(id,td,PageContext.PAGE_SCOPE); 84 return SKIP_BODY; 85 } 86 87 } 88 | Popular Tags |