1 18 package org.apache.beehive.netui.tags.databinding.script; 19 20 import javax.servlet.jsp.JspException ; 21 22 import org.apache.beehive.netui.tags.AbstractClassicTag; 23 import org.apache.beehive.netui.util.logging.Logger; 24 25 140 public class GetData 141 extends AbstractClassicTag { 142 143 private static final Logger LOGGER = Logger.getInstance(GetData.class); 144 145 private Object _value = null; 146 private String _resultId = null; 147 148 154 public String getTagName() { 155 return "GetData"; 156 } 157 158 169 public void setValue(Object value) { 170 _value = value; 171 } 172 173 183 public void setResultId(String resultId) { 184 _resultId = resultId; 185 } 186 187 192 public int doStartTag() { 193 return SKIP_BODY; 194 } 195 196 206 public int doEndTag() 207 throws JspException { 208 if(_value != null) { 209 if(LOGGER.isInfoEnabled() && pageContext.getAttribute(_resultId) != null) 210 LOGGER.info("Overwriting a value in PageContext attribute map with key \"" + _resultId + 211 "\" and object of type \"" + _value.getClass().getName()); 212 213 pageContext.setAttribute(_resultId, _value); 214 } 215 else { 216 if(LOGGER.isInfoEnabled()) 217 LOGGER.info("Removing a value from the PageContext attribute map with key \"" + _resultId + 218 "\". The object returned by the expression is null."); 219 220 pageContext.removeAttribute(_resultId); 221 } 222 223 localRelease(); 224 return EVAL_PAGE; 225 } 226 227 230 protected void localRelease() { 231 super.localRelease(); 232 _resultId = null; 233 _value = null; 234 } 235 } 236 | Popular Tags |