tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Tomcat/servlet question
Date Fri, 12 Sep 2008 21:06:11 GMT

In response to a request, a servlet opens and reads a file from disk, 
and sends the content out to the browser (ultimately), "as is".
The content of the file is an html document, saved as a text under some 
encoding, correctly encoded under that encoding, and containing an html 
<meta http-equiv="Content-type: text/html; charset=xxxx >
where the specified encoding is correct and matches the document's.

The "in" stream (the disk file) is opened "raw", and the same for the 
"out" stream.

Question :
who is responsible for setting the HTTP response headers ?
Does the servlet have to set them explicitly ? or does Tomcat do that 
itself if the servlet doesn't ? (*)
(I am specifically interested in headers like "Content-type" and 

(*) and if Tomcat does, how does it know what to put there ?

Thanks in advance,

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message