tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r391183 - in /tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector: Request.java Response.java
Date Tue, 04 Apr 2006 00:01:52 GMT
Author: remm
Date: Mon Apr  3 17:01:51 2006
New Revision: 391183

URL: http://svn.apache.org/viewcvs?rev=391183&view=rev
Log:
- Slightly updated behavior for setCharEnc, and allow setting a session cookie from an included
  resource in some cases.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewcvs/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java?rev=391183&r1=391182&r2=391183&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java Mon Apr  3 17:01:51
2006
@@ -1421,6 +1421,9 @@
     public void setCharacterEncoding(String enc)
         throws UnsupportedEncodingException {
 
+        if (usingReader)
+            return;
+        
         // Ensure that the specified encoding is valid
         byte buffer[] = new byte[1];
         buffer[0] = (byte) 'a';
@@ -2231,7 +2234,7 @@
             Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
                                        session.getIdInternal());
             configureSessionCookie(cookie);
-            response.addCookie(cookie);
+            response.addCookieInternal(cookie);
         }
 
         if (session != null) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewcvs/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java?rev=391183&r1=391182&r2=391183&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java Mon Apr  3 17:01:51
2006
@@ -908,11 +908,24 @@
      */
     public void addCookie(final Cookie cookie) {
 
-        if (isCommitted())
-            return;
-
         // Ignore any call from an included servlet
         if (included)
+            return;
+
+        addCookieInternal(cookie);
+
+    }
+
+
+    /**
+     * 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;
 
         cookies.add(cookie);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message