You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sl...@apache.org on 2009/04/09 01:13:13 UTC

svn commit: r763455 - in /myfaces/core/branches/2_0_0: api/src/main/java/javax/faces/context/ExternalContext.java impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java

Author: slessard
Date: Wed Apr  8 23:13:12 2009
New Revision: 763455

URL: http://svn.apache.org/viewvc?rev=763455&view=rev
Log:
MYFACES-2184 - Implement IMPL - all TODO methods of ExternalContext.

Modified:
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExternalContext.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java

Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExternalContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExternalContext.java?rev=763455&r1=763454&r2=763455&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExternalContext.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExternalContext.java Wed Apr  8 23:13:12 2009
@@ -278,7 +278,6 @@
      */
     public void responseFlushBuffer() throws IOException
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 
@@ -288,7 +287,6 @@
      */
     public void responseReset()
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 
@@ -302,7 +300,6 @@
      */
     public void responseSendError(int statusCode, String message) throws IOException
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 
@@ -348,7 +345,6 @@
      */
     public void setResponseBufferSize(int size)
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 
@@ -371,7 +367,6 @@
      */
     public void setResponseContentLength(int length)
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 
@@ -383,7 +378,6 @@
      */
     public void setResponseContentType(String contentType)
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 
@@ -396,7 +390,6 @@
      */
     public void setResponseHeader(String name, String value)
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
     
@@ -408,7 +401,6 @@
      */
     public void setResponseStatus(int statusCode)
     {
-        // TODO: IMPLEMENT IMPL
         throw new UnsupportedOperationException();
     }
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java?rev=763455&r1=763454&r2=763455&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java Wed Apr  8 23:13:12 2009
@@ -512,6 +512,36 @@
             throw new IllegalArgumentException("Only HttpServletResponse supported");
         }
     }
+    
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void responseFlushBuffer() throws IOException
+    {
+    	checkHttpServletResponse();
+    	_httpServletResponse.flushBuffer();
+    }
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void responseReset()
+    {
+    	checkHttpServletResponse();
+    	_httpServletResponse.reset();
+    }
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void responseSendError(int statusCode, String message) throws IOException
+    {
+       checkHttpServletResponse();
+       _httpServletResponse.sendError(statusCode, message);
+    }
 
     @Override
     @SuppressWarnings("unchecked")
@@ -580,6 +610,16 @@
     {
         this._servletResponse = (ServletResponse) response;
     }
+    
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void setResponseBufferSize(int size)
+    {
+        checkHttpServletResponse();
+        _httpServletResponse.setBufferSize(size);
+    }
 
     /**
      * @since JSF 1.2
@@ -590,6 +630,17 @@
     {
         this._servletResponse.setCharacterEncoding(encoding);
     }
+    
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void setResponseContentLength(int length)
+    {
+        checkHttpServletResponse();
+        _httpServletResponse.setContentLength(length);
+    }
+
 
     @Override
     public void setResponseContentType(String contentType)
@@ -600,6 +651,16 @@
             // Sets the content type of the response being sent to the client
             _servletResponse.setContentType(contentType);
         }
+    }  
+    
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void setResponseHeader(String name, String value)
+    {
+        checkHttpServletResponse();
+        _httpServletResponse.setHeader(name, value);
     }
 
     private void checkNull(final Object o, final String param)
@@ -685,15 +746,14 @@
     public String getContextName() {
         return _servletContext.getServletContextName();
     }
-    
     /**
-     * @since JSF 2.0
+     * @since 2.0
      */
     @Override
-    public void addResponseHeader(String name, String value)
+    public void setResponseStatus(int statusCode)
     {
-    	checkHttpServletResponse();
-    	_httpServletResponse.addHeader(name, value);
+        checkHttpServletResponse();
+        _httpServletResponse.setStatus(statusCode);
     }
     
 }