001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.engine.servlet;
018:
019: import java.io.IOException;
020: import java.util.Locale;
021:
022: import javax.servlet.http.Cookie;
023: import javax.servlet.http.HttpServletResponse;
024: import javax.servlet.http.HttpServletResponseWrapper;
025:
026: import org.apache.jetspeed.container.PortletDispatcherIncludeAware;
027:
028: /**
029: * Factory implementation for creating HTTP Response Wrappers
030: *
031: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
032: * @version $Id: ServletResponseImpl.java 516448 2007-03-09 16:25:47Z ate $
033: */
034: public class ServletResponseImpl extends HttpServletResponseWrapper
035: implements PortletDispatcherIncludeAware {
036: private boolean included;
037:
038: public ServletResponseImpl(HttpServletResponse response) {
039: super (response);
040: }
041:
042: public void setResponse(HttpServletResponse response) {
043: super .setResponse(response);
044: }
045:
046: /**
047: * @param included when true, JSR-168 PLT.16.3.3 rules need to be enforced
048: */
049: public void setPortletDispatcherIncluded(boolean included) {
050: this .included = included;
051: }
052:
053: /*
054: * JSR-168 PLT.16.3.3 .cxxxviii
055: * @deprecated use encodeRedirectURL instead
056: */
057: public String encodeRedirectUrl(String url) {
058: return (included ? null : super .encodeRedirectUrl(url));
059: }
060:
061: /*
062: * JSR-168 PLT.16.3.3 .cxxxviii
063: */
064: public String encodeRedirectURL(String url) {
065: return (included ? null : super .encodeRedirectURL(url));
066: }
067:
068: /*
069: * JSR-168 PLT.16.3.3 .cxl
070: */
071: public void addCookie(Cookie arg0) {
072: if (!included) {
073: super .addCookie(arg0);
074: }
075: }
076:
077: /*
078: * JSR-168 PLT.16.3.3 .cxl
079: */
080: public void addDateHeader(String arg0, long arg1) {
081: if (!included) {
082: super .addDateHeader(arg0, arg1);
083: }
084: }
085:
086: /*
087: * JSR-168 PLT.16.3.3 .cxl
088: */
089: public void addHeader(String arg0, String arg1) {
090: if (!included) {
091: super .addHeader(arg0, arg1);
092: }
093: }
094:
095: /*
096: * JSR-168 PLT.16.3.3 .cxl
097: */
098: public void addIntHeader(String arg0, int arg1) {
099: if (!included) {
100: super .addIntHeader(arg0, arg1);
101: }
102: }
103:
104: /*
105: * JSR-168 PLT.16.3.3 .cxl
106: */
107: public boolean containsHeader(String arg0) {
108: return (included ? false : super .containsHeader(arg0));
109: }
110:
111: /*
112: * JSR-168 PLT.16.3.3 .cxl
113: */
114: public void sendError(int arg0, String arg1) throws IOException {
115: if (!included) {
116: super .sendError(arg0, arg1);
117: }
118: }
119:
120: /*
121: * JSR-168 PLT.16.3.3 .cxl
122: */
123: public void sendRedirect(String arg0) throws IOException {
124: if (!included) {
125: super .sendRedirect(arg0);
126: }
127: }
128:
129: /*
130: * JSR-168 PLT.16.3.3 .cxl
131: */
132: public void setDateHeader(String arg0, long arg1) {
133: if (!included) {
134: super .setDateHeader(arg0, arg1);
135: }
136: }
137:
138: /*
139: * JSR-168 PLT.16.3.3 .cxl
140: */
141: public void setHeader(String arg0, String arg1) {
142: if (!included) {
143: super .setHeader(arg0, arg1);
144: }
145: }
146:
147: /*
148: * JSR-168 PLT.16.3.3 .cxl
149: */
150: public void setIntHeader(String arg0, int arg1) {
151: if (!included) {
152: super .setIntHeader(arg0, arg1);
153: }
154: }
155:
156: /*
157: * JSR-168 PLT.16.3.3 .cxl
158: */
159: public void setStatus(int arg0, String arg1) {
160: if (!included) {
161: super .setStatus(arg0, arg1);
162: }
163: }
164:
165: /*
166: * JSR-168 PLT.16.3.3 .cxl
167: */
168: public void setStatus(int arg0) {
169: if (!included) {
170: super .setStatus(arg0);
171: }
172: }
173:
174: /*
175: * JSR-168 PLT.16.3.3 .cxl
176: */
177: public void setContentLength(int arg0) {
178: if (!included) {
179: super .setContentLength(arg0);
180: }
181: }
182:
183: /*
184: * JSR-168 PLT.16.3.3 .cxl
185: */
186: public void setContentType(String arg0) {
187: if (!included) {
188: super .setContentType(arg0);
189: }
190: }
191:
192: /*
193: * JSR-168 PLT.16.3.3 .cxl
194: */
195: public void setLocale(Locale arg0) {
196: if (!included) {
197: super.setLocale(arg0);
198: }
199: }
200: }
|