[EMAIL PROTECTED] wrote:
Georg Sauer-Limbach wrote:
the question is: How do you create the output of
the servlet, that is, with which Writer or OutputStream.
yes you're right: I simply used the output stream.

Never do this if you want to output character data.
(Unless you do the encoding yourself, like in
  outStream.write( myString.getBytes( "ISO-8859-1" ) );
or you got the bytes from some pre-encoded byte data,
say, from a file; but be sure what the encoding of
that file is!)

I do not think it is very obvious, that the response class is writing the characters using the platform's default encoding in this case

Yes. And this is true for many, many places in the
Java library. Always watch out if you see some
String being processed using a Stream.

The ServletOutputStream shouldn't have all these
print methods, at least not the one for String.

Nevertheless I checked the javadoc and it correctly says, that ServletOutputStream is just for binary output (whatever the use of binary data in a website is).

Images or PDF for example.

Georg

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to