1 18 19 package org.apache.strutsel.taglib.html; 20 21 import org.apache.struts.taglib.html.MessagesTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 40 public class ELMessagesTag extends MessagesTag { 41 42 46 private String idExpr; 47 51 private String bundleExpr; 52 56 private String localeExpr; 57 61 private String nameExpr; 62 66 private String propertyExpr; 67 71 private String headerExpr; 72 76 private String footerExpr; 77 81 private String messageExpr; 82 83 87 public String getIdExpr() { return (idExpr); } 88 92 public String getBundleExpr() { return (bundleExpr); } 93 97 public String getLocaleExpr() { return (localeExpr); } 98 102 public String getNameExpr() { return (nameExpr); } 103 107 public String getPropertyExpr() { return (propertyExpr); } 108 112 public String getHeaderExpr() { return (headerExpr); } 113 117 public String getFooterExpr() { return (footerExpr); } 118 122 public String getMessageExpr() { return (messageExpr); } 123 124 128 public void setIdExpr(String idExpr) { this.idExpr = idExpr; } 129 133 public void setBundleExpr(String bundleExpr) { this.bundleExpr = bundleExpr; } 134 138 public void setLocaleExpr(String localeExpr) { this.localeExpr = localeExpr; } 139 143 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 144 148 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 149 153 public void setHeaderExpr(String headerExpr) { this.headerExpr = headerExpr; } 154 158 public void setFooterExpr(String footerExpr) { this.footerExpr = footerExpr; } 159 163 public void setMessageExpr(String messageExpr) { this.messageExpr = messageExpr; } 164 165 168 public void release() 169 { 170 super.release(); 171 setIdExpr(null); 172 setBundleExpr(null); 173 setLocaleExpr(null); 174 setNameExpr(null); 175 setPropertyExpr(null); 176 setHeaderExpr(null); 177 setFooterExpr(null); 178 setMessageExpr(null); 179 } 180 181 186 public int doStartTag() throws JspException { 187 evaluateExpressions(); 188 return(super.doStartTag()); 189 } 190 191 197 private void evaluateExpressions() throws JspException { 198 String string = null; 199 200 if ((string = EvalHelper.evalString("id", getIdExpr(), 201 this, pageContext)) != null) 202 setId(string); 203 204 if ((string = EvalHelper.evalString("bundle", getBundleExpr(), 205 this, pageContext)) != null) 206 setBundle(string); 207 208 if ((string = EvalHelper.evalString("locale", getLocaleExpr(), 209 this, pageContext)) != null) 210 setLocale(string); 211 212 if ((string = EvalHelper.evalString("name", getNameExpr(), 213 this, pageContext)) != null) 214 setName(string); 215 216 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 217 this, pageContext)) != null) 218 setProperty(string); 219 220 if ((string = EvalHelper.evalString("header", getHeaderExpr(), 221 this, pageContext)) != null) 222 setHeader(string); 223 224 if ((string = EvalHelper.evalString("footer", getFooterExpr(), 225 this, pageContext)) != null) 226 setFooter(string); 227 228 if ((string = EvalHelper.evalString("message", getMessageExpr(), 229 this, pageContext)) != null) 230 setMessage(string); 231 } 232 } 233 | Popular Tags |