01: package com.technoetic.xplanner.tags;
02:
03: import com.technoetic.xplanner.XPlannerProperties;
04: import org.apache.commons.lang.StringUtils;
05:
06: import javax.servlet.jsp.JspException;
07: import javax.servlet.jsp.tagext.TagSupport;
08:
09: public class PropertyEqualTag extends TagSupport {
10: private XPlannerProperties properties = new XPlannerProperties();
11:
12: private String key;
13: private String value;
14:
15: public int doStartTag() throws JspException {
16: return StringUtils.equals(properties.getProperty(key), value) ? EVAL_BODY_INCLUDE
17: : SKIP_BODY;
18: }
19:
20: public void setKey(String key) {
21: this .key = key;
22: }
23:
24: public void setValue(String value) {
25: this.value = value;
26: }
27: }
|