1 16 17 package org.apache.taglibs.standard.tag.common.fmt; 18 19 import javax.servlet.jsp.JspException ; 20 import javax.servlet.jsp.JspTagException ; 21 import javax.servlet.jsp.tagext.BodyTagSupport ; 22 import javax.servlet.jsp.tagext.Tag ; 23 24 import org.apache.taglibs.standard.resources.Resources; 25 26 34 35 public abstract class ParamSupport extends BodyTagSupport { 36 37 40 protected Object value; protected boolean valueSpecified; 43 44 47 public ParamSupport() { 48 super(); 49 init(); 50 } 51 52 private void init() { 53 value = null; 54 valueSpecified = false; 55 } 56 57 58 61 public int doEndTag() throws JspException { 63 Tag t = findAncestorWithClass(this, MessageSupport.class); 64 if (t == null) { 65 throw new JspTagException (Resources.getMessage( 66 "PARAM_OUTSIDE_MESSAGE")); 67 } 68 MessageSupport parent = (MessageSupport) t; 69 70 75 Object input = null; 76 if (valueSpecified) { 78 input = value; 80 } else { 81 input = bodyContent.getString().trim(); 84 } 85 parent.addParam(input); 86 87 return EVAL_PAGE; 88 } 89 90 public void release() { 92 init(); 93 } 94 } 95 | Popular Tags |