remm 2002/11/09 09:12:05 Modified: coyote/src/java/org/apache/coyote Response.java Log: - Refactor special header handling. - The special headers are now set in the protocol handler, which allows enforcing the protocol (as it is not possible to remove headers from the MimeHeaders). - This may not be compatible with Coyote JK 2. Please review. Revision Changes Path 1.16 +15 -10 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java Index: Response.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Response.java 12 Sep 2002 06:42:11 -0000 1.15 +++ Response.java 9 Nov 2002 17:12:04 -0000 1.16 @@ -142,7 +142,7 @@ protected String contentLanguage = null; protected String characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING; protected int contentLength = -1; - private Locale locale = Constants.DEFAULT_LOCALE; + private Locale locale = null;//Constants.DEFAULT_LOCALE; /** * Holds request error exception. @@ -311,7 +311,8 @@ // Reset the headers only if this is the main request, // not for included contentType = Constants.DEFAULT_CONTENT_TYPE; - locale = Constants.DEFAULT_LOCALE; + locale = null;//Constants.DEFAULT_LOCALE; + contentLanguage = null; characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING; contentLength = -1; @@ -386,9 +387,9 @@ setContentLength( cL ); return true; } catch( NumberFormatException ex ) { - // Do nothing - the spec doesn't have any "throws" - // and the user might know what he's doing - return false; + // Do nothing - the spec doesn't have any "throws" + // and the user might know what he's doing + return false; } } if( name.equalsIgnoreCase( "Content-Language" ) ) { @@ -437,12 +438,18 @@ value.append('-'); value.append(country); } - // only one header ! - headers.setValue("Content-Language").setString(value.toString()); + contentLanguage = value.toString(); } } + /** + * Return the content language. + */ + public String getContentLanguage() { + return contentLanguage; + } + /* * Overrides the name of the character encoding used in the body * of the request. This method must be called prior to reading @@ -488,7 +495,6 @@ if (encoding != null) { characterEncoding = encoding; } - headers.setValue("Content-Type").setString(contentType); } public String getContentType() { @@ -497,7 +503,6 @@ public void setContentLength(int contentLength) { this.contentLength = contentLength; - headers.setValue("Content-Length").setInt(contentLength); } public int getContentLength() { @@ -520,7 +525,7 @@ contentType = Constants.DEFAULT_CONTENT_TYPE; contentLanguage = null; - locale = Constants.DEFAULT_LOCALE; + locale = null;//Constants.DEFAULT_LOCALE; characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING; contentLength = -1; status = 200;
-- To unsubscribe, e-mail: <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>