jfarcand 2002/12/03 08:37:59
Modified: coyote/src/java/org/apache/coyote Response.java
coyote/src/java/org/apache/coyote/tomcat5
CoyoteResponse.java
Log:
Go back and set the locale in Response (required by 2.3 and 2.4). Watchdog is
falling if the getLocale returns null ;-)
Revision Changes Path
1.19 +9 -3
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.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Response.java 3 Dec 2002 16:04:02 -0000 1.18
+++ Response.java 3 Dec 2002 16:37:59 -0000 1.19
@@ -92,6 +92,12 @@
// ----------------------------------------------------- Instance Variables
+
+ /**
+ * Default locale as mandated by the spec.
+ */
+ private static Locale DEFAULT_LOCALE = new Locale("en", "US");
+
/**
* Status code.
@@ -142,7 +148,7 @@
protected String contentLanguage = null;
protected String characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING;
protected int contentLength = -1;
- private Locale locale = null;
+ private Locale locale = DEFAULT_LOCALE;
/**
* Holds request error exception.
@@ -311,7 +317,7 @@
// Reset the headers only if this is the main request,
// not for included
contentType = Constants.DEFAULT_CONTENT_TYPE;
- locale = null;
+ locale = DEFAULT_LOCALE;
contentLanguage = null;
characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING;
contentLength = -1;
@@ -525,7 +531,7 @@
contentType = Constants.DEFAULT_CONTENT_TYPE;
contentLanguage = null;
- locale = null;
+ locale = DEFAULT_LOCALE;
characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING;
contentLength = -1;
status = 200;
1.14 +4 -14
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteResponse.java
Index: CoyoteResponse.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteResponse.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- CoyoteResponse.java 3 Dec 2002 16:04:02 -0000 1.13
+++ CoyoteResponse.java 3 Dec 2002 16:37:59 -0000 1.14
@@ -136,12 +136,6 @@
// ----------------------------------------------------- Instance Variables
- /**
- * Default locale as mandated by the spec.
- */
- private static Locale DEFAULT_LOCALE = new Locale("en", "US");
-
-
/**
* The date format we will use for creating date headers.
*/
@@ -612,10 +606,6 @@
* Return the Locale assigned to this response.
*/
public Locale getLocale() {
- // Lazy setting. If the local is null, then return the default one.
- if ( coyoteResponse.getLocale() == null){
- coyoteResponse.setLocale(DEFAULT_LOCALE);
- }
return (coyoteResponse.getLocale());
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>