1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.fatwire.gst.foundation.taglib;
17
18 import java.io.IOException;
19 import javax.servlet.jsp.JspException;
20
21 import COM.FutureTense.Interfaces.ICS;
22
23 import com.fatwire.gst.foundation.properties.AssetApiPropertyDao;
24 import com.fatwire.gst.foundation.properties.Property;
25 import com.fatwire.gst.foundation.properties.PropertyDao;
26
27
28
29
30
31
32
33 public final class GetPropertyTag extends GsfSimpleTag {
34
35 private String name;
36 private String property;
37
38
39
40
41
42
43 @Override
44 public void doTag() throws JspException, IOException {
45 final ICS ics = getICS();
46 PropertyDao propertyDao = AssetApiPropertyDao.getInstance(ics);
47 Property p = propertyDao.getProperty(property);
48 if (p != null) {
49 getJspContext().setAttribute(name, p.asString());
50 }
51 super.doTag();
52 }
53
54
55
56
57 public void setName(final String name) {
58 this.name = name;
59 }
60
61
62
63
64 public void setProperty(final String property) {
65 this.property = property;
66 }
67 }