yoavs 2004/07/28 08:00:32
Modified: catalina/src/share/org/apache/catalina/valves
ErrorReportValve.java
webapps/docs changelog.xml
Log:
Addressed Bugzilla 28875, ErrorReportValve default encoding to UTF-8.
Revision Changes Path
1.22 +17 -15
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java
Index: ErrorReportValve.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/ErrorReportValve.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ErrorReportValve.java 27 Jun 2004 23:56:23 -0000 1.21
+++ ErrorReportValve.java 28 Jul 2004 15:00:32 -0000 1.22
@@ -48,6 +48,7 @@
* @author Craig R. McClanahan
* @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
+ * @author Yoav Shapira
* @version $Revision$ $Date$
*/
@@ -284,28 +285,29 @@
try {
- Writer writer = response.getReporter();
+ try {
- if (writer != null) {
+ response.setContentType("text/html");
+ response.setCharacterEncoding("utf-8");
- Locale locale = Locale.getDefault();
+ } catch (Throwable t) {
- try {
- response.setContentType("text/html");
- response.setLocale(locale);
- } catch (Throwable t) {
- if (container.getLogger().isDebugEnabled())
- container.getLogger().debug("status.setContentType", t);
- }
+ if (container.getLogger().isDebugEnabled())
+ container.getLogger().debug("status.setContentType", t);
- // If writer is null, it's an indication that the response has
- // been hard committed already, which should never happen
- writer.write(sb.toString());
+ }
- }
+ Writer writer = response.getReporter();
+
+ if (writer != null) {
+ // If writer is null, it's an indication that the response has
+ // been hard committed already, which should never happen
+ writer.write(sb.toString());
+ }
} catch (IOException e) {
;
+
} catch (IllegalStateException e) {
;
}
1.80 +3 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml
Index: changelog.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- changelog.xml 28 Jul 2004 14:49:50 -0000 1.79
+++ changelog.xml 28 Jul 2004 15:00:32 -0000 1.80
@@ -40,6 +40,9 @@
<fix>
<bug>29831</bug>: Added support for Boolean property to BeanFactory. (yoavs)
</fix>
+ <fix>
+ <bug>28875</bug>: Made ErrorReportValve use UTF-8 encoding by default.
(yoavs)
+ </fix>
</changelog>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]