Author: jbq
Date: Fri Mar  9 13:59:22 2007
New Revision: 516578

URL: http://svn.apache.org/viewvc?view=rev&rev=516578
Log:
WICKET-313 Use standard exception handling in AjaxRequestTarget

It is not really useful to put a List of status codes, keep one status code only

Modified:
    
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/BufferedHttpServletResponse.java

Modified: 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/BufferedHttpServletResponse.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/BufferedHttpServletResponse.java?view=diff&rev=516578&r1=516577&r2=516578
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/BufferedHttpServletResponse.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/BufferedHttpServletResponse.java
 Fri Mar  9 13:59:22 2007
@@ -54,8 +54,8 @@
        /** cookies list */
        private List cookies;
 
-       /** status list */
-       private List status;
+       /** status code */
+       private int status = -1;
 
        /** headers map */
        private Map headers;
@@ -283,23 +283,20 @@
        /**
         * @see javax.servlet.http.HttpServletResponse#setStatus(int)
         */
-       public void setStatus(int sc)
+       public void setStatus(int statusCode)
        {
-               if (status == null)
-               {
-                       status = new ArrayList(2);
-               }
-               status.add(new Integer(sc));
+               status = statusCode;
        }
 
        /**
         * @see javax.servlet.http.HttpServletResponse#setStatus(int,
         *      java.lang.String)
-        * @deprecated
+        * @deprecated use setStatus(int) instead
         */
        public void setStatus(int sc, String sm)
        {
-               throw new UnsupportedOperationException("not supported in tbe 
bufferd http response, use setStatus");
+               throw new UnsupportedOperationException(
+                               "not supported in the buffered http response, 
use setStatus(int)");
        }
 
        /**
@@ -512,13 +509,9 @@
         */
        public void writeTo(HttpServletResponse servletResponse) throws 
IOException
        {
-               if (status != null)
+               if (status != -1)
                {
-                       Iterator it = status.iterator();
-                       while (it.hasNext())
-                       {
-                               servletResponse.setStatus( 
((Integer)it.next()).intValue());
-                       }
+                       servletResponse.setStatus(status);
                }
                if (headers != null)
                {


Reply via email to