1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.engine.servlet;
18
19 import java.io.IOException;
20 import java.util.Locale;
21
22 import javax.servlet.http.Cookie;
23 import javax.servlet.http.HttpServletResponse;
24 import javax.servlet.http.HttpServletResponseWrapper;
25
26 import org.apache.jetspeed.container.PortletDispatcherIncludeAware;
27
28 /***
29 * Factory implementation for creating HTTP Response Wrappers
30 *
31 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
32 * @version $Id: ServletResponseImpl.java 516448 2007-03-09 16:25:47Z ate $
33 */
34 public class ServletResponseImpl extends HttpServletResponseWrapper implements PortletDispatcherIncludeAware
35 {
36 private boolean included;
37
38 public ServletResponseImpl(HttpServletResponse response)
39 {
40 super(response);
41 }
42
43 public void setResponse(HttpServletResponse response)
44 {
45 super.setResponse(response);
46 }
47
48 /***
49 * @param included when true, JSR-168 PLT.16.3.3 rules need to be enforced
50 */
51 public void setPortletDispatcherIncluded(boolean included)
52 {
53 this.included = included;
54 }
55
56
57
58
59
60 public String encodeRedirectUrl(String url)
61 {
62 return (included ? null : super.encodeRedirectUrl(url));
63 }
64
65
66
67
68 public String encodeRedirectURL(String url)
69 {
70 return (included ? null : super.encodeRedirectURL(url));
71 }
72
73
74
75
76 public void addCookie(Cookie arg0)
77 {
78 if (!included)
79 {
80 super.addCookie(arg0);
81 }
82 }
83
84
85
86
87 public void addDateHeader(String arg0, long arg1)
88 {
89 if (!included)
90 {
91 super.addDateHeader(arg0, arg1);
92 }
93 }
94
95
96
97
98 public void addHeader(String arg0, String arg1)
99 {
100 if (!included)
101 {
102 super.addHeader(arg0, arg1);
103 }
104 }
105
106
107
108
109 public void addIntHeader(String arg0, int arg1)
110 {
111 if (!included)
112 {
113 super.addIntHeader(arg0, arg1);
114 }
115 }
116
117
118
119
120 public boolean containsHeader(String arg0)
121 {
122 return (included ? false : super.containsHeader(arg0));
123 }
124
125
126
127
128 public void sendError(int arg0, String arg1) throws IOException
129 {
130 if (!included)
131 {
132 super.sendError(arg0, arg1);
133 }
134 }
135
136
137
138
139 public void sendRedirect(String arg0) throws IOException
140 {
141 if (!included)
142 {
143 super.sendRedirect(arg0);
144 }
145 }
146
147
148
149
150 public void setDateHeader(String arg0, long arg1)
151 {
152 if (!included)
153 {
154 super.setDateHeader(arg0, arg1);
155 }
156 }
157
158
159
160
161 public void setHeader(String arg0, String arg1)
162 {
163 if (!included)
164 {
165 super.setHeader(arg0, arg1);
166 }
167 }
168
169
170
171
172 public void setIntHeader(String arg0, int arg1)
173 {
174 if (!included)
175 {
176 super.setIntHeader(arg0, arg1);
177 }
178 }
179
180
181
182
183 public void setStatus(int arg0, String arg1)
184 {
185 if (!included)
186 {
187 super.setStatus(arg0, arg1);
188 }
189 }
190
191
192
193
194 public void setStatus(int arg0)
195 {
196 if (!included)
197 {
198 super.setStatus(arg0);
199 }
200 }
201
202
203
204
205 public void setContentLength(int arg0)
206 {
207 if (!included)
208 {
209 super.setContentLength(arg0);
210 }
211 }
212
213
214
215
216 public void setContentType(String arg0)
217 {
218 if (!included)
219 {
220 super.setContentType(arg0);
221 }
222 }
223
224
225
226
227 public void setLocale(Locale arg0)
228 {
229 if (!included)
230 {
231 super.setLocale(arg0);
232 }
233 }
234 }