1 18 19 package org.apache.strutsel.taglib.logic; 20 21 import org.apache.struts.taglib.logic.NotPresentTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 37 public class ELNotPresentTag extends NotPresentTag { 38 39 43 private String cookieExpr; 44 48 private String headerExpr; 49 53 private String nameExpr; 54 58 private String parameterExpr; 59 63 private String propertyExpr; 64 68 private String roleExpr; 69 73 private String scopeExpr; 74 78 private String userExpr; 79 80 84 public String getCookieExpr() { return (cookieExpr); } 85 89 public String getHeaderExpr() { return (headerExpr); } 90 94 public String getNameExpr() { return (nameExpr); } 95 99 public String getParameterExpr() { return (parameterExpr); } 100 104 public String getPropertyExpr() { return (propertyExpr); } 105 109 public String getRoleExpr() { return (roleExpr); } 110 114 public String getScopeExpr() { return (scopeExpr); } 115 119 public String getUserExpr() { return (userExpr); } 120 121 125 public void setCookieExpr(String cookieExpr) { this.cookieExpr = cookieExpr; } 126 130 public void setHeaderExpr(String headerExpr) { this.headerExpr = headerExpr; } 131 135 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 136 140 public void setParameterExpr(String parameterExpr) { this.parameterExpr = parameterExpr; } 141 145 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 146 150 public void setRoleExpr(String roleExpr) { this.roleExpr = roleExpr; } 151 155 public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; } 156 160 public void setUserExpr(String userExpr) { this.userExpr = userExpr; } 161 162 165 public void release() 166 { 167 super.release(); 168 setCookieExpr(null); 169 setHeaderExpr(null); 170 setNameExpr(null); 171 setParameterExpr(null); 172 setPropertyExpr(null); 173 setRoleExpr(null); 174 setScopeExpr(null); 175 setUserExpr(null); 176 } 177 178 183 public int doStartTag() throws JspException { 184 evaluateExpressions(); 185 return (super.doStartTag()); 186 } 187 188 194 private void evaluateExpressions() throws JspException { 195 String string = null; 196 197 if ((string = EvalHelper.evalString("cookie", getCookieExpr(), 198 this, pageContext)) != null) 199 setCookie(string); 200 201 if ((string = EvalHelper.evalString("header", getHeaderExpr(), 202 this, pageContext)) != null) 203 setHeader(string); 204 205 if ((string = EvalHelper.evalString("name", getNameExpr(), 206 this, pageContext)) != null) 207 setName(string); 208 209 if ((string = EvalHelper.evalString("parameter", getParameterExpr(), 210 this, pageContext)) != null) 211 setParameter(string); 212 213 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 214 this, pageContext)) != null) 215 setProperty(string); 216 217 if ((string = EvalHelper.evalString("role", getRoleExpr(), 218 this, pageContext)) != null) 219 setRole(string); 220 221 if ((string = EvalHelper.evalString("scope", getScopeExpr(), 222 this, pageContext)) != null) 223 setScope(string); 224 225 if ((string = EvalHelper.evalString("user", getUserExpr(), 226 this, pageContext)) != null) 227 setUser(string); 228 } 229 } 230 | Popular Tags |