Author: markt Date: Wed Aug 25 11:24:42 2010 New Revision: 989015 URL: http://svn.apache.org/viewvc?rev=989015&view=rev Log: Minor clean-up. Merge methods.
Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=989015&r1=989014&r2=989015&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Wed Aug 25 11:24:42 2010 @@ -948,11 +948,15 @@ public class Response public void addCookie(final Cookie cookie) { // Ignore any call from an included servlet - if (included) + if (included || isCommitted()) return; - addCookieInternal(cookie); - + final StringBuffer sb = generateCookieString(cookie); + //if we reached here, no exception, cookie is valid + // the header name is Set-Cookie for both "old" and v.1 ( RFC2109 ) + // RFC2965 is not supported by browsers and the Servlet spec + // asks for 2109. + addHeader("Set-Cookie", sb.toString()); } /** @@ -985,24 +989,6 @@ public class Response } - /** - * Add the specified Cookie to those that will be included with - * this Response. - * - * @param cookie Cookie to be added - */ - public void addCookieInternal(final Cookie cookie) { - - if (isCommitted()) - return; - - final StringBuffer sb = generateCookieString(cookie); - //if we reached here, no exception, cookie is valid - // the header name is Set-Cookie for both "old" and v.1 ( RFC2109 ) - // RFC2965 is not supported by browsers and the Servlet spec - // asks for 2109. - addHeader("Set-Cookie", sb.toString()); - } public StringBuffer generateCookieString(final Cookie cookie) { final StringBuffer sb = new StringBuffer(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org