1 16 package com.blandware.atleap.webapp.taglib.core.grid; 17 18 import org.apache.commons.logging.Log; 19 import org.apache.commons.logging.LogFactory; 20 21 import javax.servlet.jsp.JspTagException ; 22 import javax.servlet.jsp.PageContext ; 23 import javax.servlet.jsp.tagext.SimpleTagSupport ; 24 25 49 public class QueryParameterTag extends SimpleTagSupport { 50 51 protected transient final Log log = LogFactory.getLog(QueryParameterTag.class); 52 53 56 protected String name; 57 58 61 protected Object value; 62 63 72 public String getName() { 73 return name; 74 } 75 76 81 public void setName(String name) { 82 this.name = name; 83 } 84 85 94 public Object getValue() { 95 return value; 96 } 97 98 103 public void setValue(Object value) { 104 this.value = value; 105 } 106 107 112 public void doTag() throws JspTagException { 113 114 PageContext pageContext = (PageContext ) getJspContext(); 115 116 GridTag parentGridTag = (GridTag) findAncestorWithClass(this, GridTag.class); 117 118 if ( parentGridTag == null ) { 119 JspTagException e = new JspTagException ("Parent tag is invalid! This tag is only valid when nested within 'grid' tag"); 120 throw e; 121 } 122 123 parentGridTag.getGrid().addQueryParameter(name, value); 124 } 125 126 } 127 | Popular Tags |