1 18 19 package org.apache.strutsel.taglib.logic; 20 21 import org.apache.struts.taglib.logic.MessagesPresentTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 39 public class ELMessagesPresentTag extends MessagesPresentTag { 40 41 45 private String nameExpr; 46 50 private String propertyExpr; 51 55 private String messageExpr; 56 57 61 public String getNameExpr() { return (nameExpr); } 62 66 public String getPropertyExpr() { return (propertyExpr); } 67 71 public String getMessageExpr() { return (messageExpr); } 72 73 77 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 78 82 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 83 87 public void setMessageExpr(String messageExpr) { this.messageExpr = messageExpr; } 88 89 92 public void release() 93 { 94 super.release(); 95 setNameExpr(null); 96 setPropertyExpr(null); 97 setMessageExpr(null); 98 } 99 100 105 public int doStartTag() throws JspException { 106 evaluateExpressions(); 107 return (super.doStartTag()); 108 } 109 110 116 private void evaluateExpressions() throws JspException { 117 String string = null; 118 119 if ((string = EvalHelper.evalString("name", getNameExpr(), 120 this, pageContext)) != null) 121 setName(string); 122 123 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 124 this, pageContext)) != null) 125 setProperty(string); 126 127 if ((string = EvalHelper.evalString("message", getMessageExpr(), 128 this, pageContext)) != null) 129 setMessage(string); 130 } 131 } 132 | Popular Tags |