tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: slow servlet filter for ByteArrayOutputStream response Wrapper
Date Tue, 01 Jun 2010 09:41:09 GMT
2010/6/1 Manny Mondeo <mannynab@yahoo.com>:
>          httpRes.setContentLength(content.toString().length());

Also, the above, or simplier "content.length()", will give you the
length measured in characters,  but Content-Length must be the length
measured in bytes.  For a multi-byte charset such as UTF-8 those are
certainly not the same. (Unless all your characters are 7-bit).

>          httpRes.setContentType( "text/html; charset=UTF-8" ) ;
>          out.write(content);
>          out.flush();
>          out.close();
>
>      }
>

Best regards,
Konstantin Kolinko

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


Mime
View raw message