01: package com.technoetic.xplanner.tags;
02:
03: import com.technoetic.xplanner.XPlannerProperties;
04:
05: import javax.servlet.jsp.JspException;
06: import javax.servlet.jsp.tagext.TagSupport;
07: import java.io.IOException;
08:
09: public class PropertyTag extends TagSupport {
10: private String key;
11: private XPlannerProperties properties = new XPlannerProperties();
12:
13: public int doEndTag() throws JspException {
14: try {
15: pageContext.getOut().print(properties.getProperty(key));
16: } catch (IOException ex) {
17: throw new JspException("IO error");
18: }
19: return EVAL_PAGE;
20: }
21:
22: public void setKey(String key) {
23: this.key = key;
24: }
25: }
|