You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2007/09/05 23:10:08 UTC
svn commit: r573056 -
/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterResponseWrapper.java
Author: imario
Date: Wed Sep 5 14:10:07 2007
New Revision: 573056
URL: http://svn.apache.org/viewvc?rev=573056&view=rev
Log:
use HttpServletResponseWrapper instead the interface - some app-server like websphere might depend on it. Thanks to Bernhard Huemer for the tip!
Modified:
myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterResponseWrapper.java
Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterResponseWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterResponseWrapper.java?rev=573056&r1=573055&r2=573056&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterResponseWrapper.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterResponseWrapper.java Wed Sep 5 14:10:07 2007
@@ -16,224 +16,32 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.myfaces.orchestra.requestParameterProvider;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Locale;
+import javax.servlet.http.HttpServletResponseWrapper;
/**
* This wrapper intercepts encodeURL and pass it to the {@link RequestParameterProviderManager} which attaches the url parameters
*/
-public class RequestParameterResponseWrapper implements HttpServletResponse
+public class RequestParameterResponseWrapper extends HttpServletResponseWrapper
{
- protected HttpServletResponse original;
-
-
public RequestParameterResponseWrapper(HttpServletResponse httpServletResponse)
{
- //super();
- this.original = httpServletResponse;
+ super(httpServletResponse);
}
- /**
+ /**
* @param url the url to encode
* @return wrappedResponse.encodeUrl(url);
*/
public String encodeURL(String url)
{
- if (url == null)
+ if (url != null)
{
- return null;
+ url = RequestParameterProviderManager.getInstance().encodeAndAttachParameters(url);
}
- url = RequestParameterProviderManager.getInstance().encodeAndAttachParameters(url);
-
- return this.original.encodeURL(url);
- }
-
- /**
- * @param url the url to encode
- * @return wrappedResponse.encodeUrl(url);
- */
-
- public String encodeRedirectURL(String url)
- {
- return this.original.encodeRedirectURL(url);
- }
-
-
- /**
- * @param url the url to encode
- * @return wrappedResponse.encodeUrl(url);
- * @deprecated uses deprecated Method.
- */
- public String encodeUrl(String url)
- {
- return this.original.encodeUrl(url);
- }
-
-
- /**
- * @param url the url to encode
- * @return wrappedResponse.encodeUrl(url);
- * @deprecated uses deprecated Method.
- */
- public String encodeRedirectUrl(String url)
- {
- return this.original.encodeRedirectUrl(url);
- }
-
- //simple delegation
-
- public void addCookie(Cookie cookie)
- {
- this.original.addCookie(cookie);
- }
-
-
- public boolean containsHeader(String header)
- {
- return this.original.containsHeader(header);
- }
-
- public void sendError(int i, String string) throws IOException
- {
- this.original.sendError(i, string);
- }
-
- public void sendError(int i) throws IOException
- {
- this.original.sendError(i);
- }
-
- public void sendRedirect(String string) throws IOException
- {
- this.original.sendRedirect(string);
- }
-
- public void setDateHeader(String string, long l)
- {
- this.original.setDateHeader(string, l);
- }
-
- public void addDateHeader(String string, long l)
- {
- this.original.addDateHeader(string, l);
- }
-
- public void setHeader(String string, String string1)
- {
- this.original.setHeader(string, string1);
- }
-
- public void addHeader(String string, String string1)
- {
- this.original.addHeader(string, string1);
- }
-
- public void setIntHeader(String string, int i)
- {
- this.original.setIntHeader(string, i);
- }
-
- public void addIntHeader(String string, int i)
- {
- this.original.addIntHeader(string, i);
- }
-
- public void setStatus(int i)
- {
- this.original.setStatus(i);
- }
-
-
- /**
- * @deprecated uses deprecated Method
- */
-
- public void setStatus(int i, String string)
- {
- this.original.setStatus(i, string);
- }
-
- public String getCharacterEncoding()
- {
- return this.original.getCharacterEncoding();
- }
-
- public String getContentType()
- {
- return this.original.getContentType();
- }
-
- public ServletOutputStream getOutputStream() throws IOException
- {
- return this.original.getOutputStream();
- }
-
- public PrintWriter getWriter() throws IOException
- {
- return this.original.getWriter();
- }
-
- public void setCharacterEncoding(String encoding)
- {
- this.original.setCharacterEncoding(encoding);
- }
-
- public void setContentLength(int i)
- {
- this.original.setContentLength(i);
- }
-
- public void setContentType(String string)
- {
- this.original.setContentType(string);
- }
-
- public void setBufferSize(int i)
- {
- this.original.setBufferSize(i);
- }
-
- public int getBufferSize()
- {
- return this.original.getBufferSize();
- }
-
- public void flushBuffer() throws IOException
- {
- this.original.flushBuffer();
- }
-
- public void resetBuffer()
- {
- this.original.resetBuffer();
- }
-
- public boolean isCommitted()
- {
- return this.original.isCommitted();
- }
-
- public void reset()
- {
- this.original.reset();
- }
-
- public void setLocale(Locale locale)
- {
- this.original.setLocale(locale);
- }
-
- public Locale getLocale()
- {
- return this.original.getLocale();
+ return super.encodeURL(url);
}
}