Just a question ...
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Delivered-To: [EMAIL PROTECTED]
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/context
DefaultCMSetter.java
>
> marcsaeg 01/03/16 16:26:44
>
> Modified: src/share/org/apache/tomcat/context Tag: tomcat_32
> DefaultCMSetter.java
> Log:
> Use the default locale for generated error pages.
>
> Reported by [EMAIL PROTECTED] (Yoshiyuki Karezaki).
>
> PR: 691
> Submitted by: Kazuhiro Kazama
>
> Revision Changes Path
> No revision
>
>
> No revision
>
>
> 1.45.2.9 +20 -4
jakarta-tomcat/src/share/org/apache/tomcat/context/Attic/DefaultCMSetter.java
>
> Index: DefaultCMSetter.java
> ===================================================================
> RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/Attic/DefaultCMSe
tter.java,v
> retrieving revision 1.45.2.8
> retrieving revision 1.45.2.9
> diff -u -r1.45.2.8 -r1.45.2.9
> --- DefaultCMSetter.java 2000/11/11 02:56:57 1.45.2.8
> +++ DefaultCMSetter.java 2001/03/17 00:26:39 1.45.2.9
> @@ -151,7 +151,11 @@
> public void doService(Request req, Response res)
> throws Exception
> {
> - res.setContentType("text/html"); // ISO-8859-1 default
Shouldn't the charset be according to the Locale and Charset of the
request that was passed ?
Arieh
> + String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
> + if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
> + res.setContentType("text/html");
> + else
> + res.setContentType("text/html; charset=" + charset);
>
> String requestURI = (String)req.
> getAttribute("javax.servlet.include.request_uri");
> @@ -226,7 +230,11 @@
> return;
> }
>
> - res.setContentType("text/html");
> + String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
> + if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
> + res.setContentType("text/html");
> + else
> + res.setContentType("text/html; charset=" + charset);
> res.setStatus( 500 );
>
> StringBuffer buf = new StringBuffer();
> @@ -331,7 +339,11 @@
> String msg=(String)req.getAttribute("javax.servlet.error.message");
> String errorURI = res.getErrorURI();
>
> - res.setContentType("text/html");
> + String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
> + if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
> + res.setContentType("text/html");
> + else
> + res.setContentType("text/html; charset=" + charset);
> // res is reset !!!
> // status is already set
> int sc=res.getStatus();
> @@ -432,7 +444,11 @@
>
> if( debug>0) ctx.log("Redirect " + location + " " + req );
>
> - res.setContentType("text/html"); // ISO-8859-1 default
> + String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
> + if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
> + res.setContentType("text/html");
> + else
> + res.setContentType("text/html; charset=" + charset);
> res.setHeader("Location", location);
>
> StringBuffer buf = new StringBuffer();
>
>
>
--
Arieh Markel Sun Microsystems Inc.
Network Storage 500 Eldorado Blvd. MS UBRM11-194
e-mail: [EMAIL PROTECTED] Broomfield, CO 80021
Pray for snow !!!! Phone: (303) 272-8547 x78547
(e-mail me with subject SEND PUBLIC KEY to get public key)