Register / Login
This week's giveaway is in the
We're giving away four copies of
Java EE 8 High Performance
and have Romain Manni-Bucau on-line!
I still don't see what value I should use with setContentLength() however.
posted 7 years ago
It automatically sets the Content-Length header to whatever the size of your output is. You don't have to manully set it as far as I know.
I was going to say that you
set the encoding with PrintWriter...but you can only do this in the constructor, which you obviously never call, since you get the PrintWriter by calling getWriter().
EDIT: Also, you don't need to call flush()...it flushes the response automatically.
SCJP 6 || SCWCD 5
It is sorta covered in the
JavaRanch Style Guide
Boost this thread!
responseXML.documentElement returns null object
Uploading a text file to a blob in MySql, then downloading that file to local file system
Read Arabic text in Servlet
Jsonp is not in expected format