1 64 65 package com.jcorporate.expresso.ext.struts.taglib.bean; 66 67 import com.jcorporate.expresso.core.misc.StringUtil; 68 import com.jcorporate.expresso.ext.struts.taglib.ControllerUtils; 69 import org.apache.struts.taglib.bean.WriteTag; 70 import org.apache.struts.util.ResponseUtils; 71 72 import javax.servlet.jsp.JspException ; 73 74 75 82 public class ExWriteTag 83 extends WriteTag { 84 public ExWriteTag() { 85 super(); 86 filter = false; 87 } 88 95 public int doStartTag() 96 throws JspException { 97 98 Object value = ControllerUtils.getBeanProperty(pageContext, name, 100 property, ignore); 101 102 if (value == null) { 103 if (name == null) { 104 throw new JspException ("No such element/property in " + 105 "ControllerResponse as '" + 106 StringUtil.notNull(property) + "'"); 107 } else { 108 throw new JspException ("No such property as '" + 109 StringUtil.notNull(property) + 110 "' in element '" + name + "'"); 111 } 112 } 113 114 String output = value.toString(); 116 117 if (filter) { 118 ResponseUtils.write(pageContext, ResponseUtils.filter(output)); 119 } else { 120 ResponseUtils.write(pageContext, output); 121 } 122 123 return (SKIP_BODY); 125 } 126 } 127 | Popular Tags |