1
2
3
4 package org.apache.tiles.jsp.taglib;
5
6 import java.io.IOException;
7
8 import javax.servlet.jsp.JspException;
9 import javax.servlet.jsp.tagext.SimpleTagSupport;
10
11 import org.apache.tiles.autotag.core.runtime.ModelBody;
12 import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
13
14
15
16
17
18
19
20
21
22
23
24
25
26 public class AddAttributeTag extends SimpleTagSupport {
27
28
29
30
31 private org.apache.tiles.template.AddAttributeModel model = new org.apache.tiles.template.AddAttributeModel();
32
33
34
35
36
37 private java.lang.Object value;
38
39
40
41
42
43 private java.lang.String expression;
44
45
46
47
48
49 private java.lang.String role;
50
51
52
53
54 private java.lang.String type;
55
56
57
58
59
60
61
62
63 public java.lang.Object getValue() {
64 return value;
65 }
66
67
68
69
70
71
72
73
74 public void setValue(java.lang.Object value) {
75 this.value = value;
76 }
77
78
79
80
81
82
83
84
85 public java.lang.String getExpression() {
86 return expression;
87 }
88
89
90
91
92
93
94
95
96 public void setExpression(java.lang.String expression) {
97 this.expression = expression;
98 }
99
100
101
102
103
104
105
106
107 public java.lang.String getRole() {
108 return role;
109 }
110
111
112
113
114
115
116
117
118 public void setRole(java.lang.String role) {
119 this.role = role;
120 }
121
122
123
124
125
126
127
128 public java.lang.String getType() {
129 return type;
130 }
131
132
133
134
135
136
137
138 public void setType(java.lang.String type) {
139 this.type = type;
140 }
141
142
143 @Override
144 public void doTag() throws JspException, IOException {
145 AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
146 if (runtime instanceof SimpleTagSupport) {
147 SimpleTagSupport tag = (SimpleTagSupport) runtime;
148 tag.setJspContext(getJspContext());
149 tag.setJspBody(getJspBody());
150 tag.setParent(getParent());
151 tag.doTag();
152 }
153 org.apache.tiles.request.Request request = runtime.createRequest();
154 ModelBody modelBody = runtime.createModelBody();
155 model.execute(
156 value,
157 expression,
158 role,
159 type,
160 request, modelBody
161 );
162 }
163 }