1 18 package org.apache.beehive.netui.tags.html; 19 20 22 24 import org.apache.beehive.netui.tags.AbstractClassicTag; 25 import org.apache.beehive.netui.util.Bundle; 26 27 import javax.servlet.jsp.JspException ; 28 import javax.servlet.jsp.tagext.JspTag ; 29 import javax.servlet.jsp.tagext.SimpleTagSupport ; 30 31 49 public class Parameter 50 extends AbstractClassicTag 51 { 52 private String _name = null; 53 private Object _value = null; 54 55 58 public String getTagName() 59 { 60 return "Parameter"; 61 } 62 63 72 public void setName(String name) 73 { 74 _name = name; 75 } 76 77 86 public void setValue(Object value) 87 throws JspException 88 { 89 _value = value; 90 } 91 92 96 public int doStartTag() throws JspException 97 { 98 JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, IUrlParams.class); 99 if (parentTag == null) { 100 String msg = Bundle.getString("Tags_InvalidParameterParent"); 101 registerTagError(msg, null); 102 reportErrors(); 103 } 104 else { 105 IUrlParams parent = (IUrlParams) parentTag; 106 parent.addParameter(_name, _value, null); 107 } 108 localRelease(); 109 return SKIP_BODY; 110 } 111 112 115 protected void localRelease() 116 { 117 super.localRelease(); 118 119 _name = null; 120 _value = null; 121 } 122 } 123 | Popular Tags |