If the response fits in the output buffer (8kB by default) then because Tomcat can buffer the whole response it knows how long it is. In that case Tomcat sets the content-length header.

If the response is larger than the output buffer then Tomcat will use chunked encoding.

Mark


On 04/12/2024 13:50, Brian Proffitt wrote:
---------- Forwarded message ---------
From: 胡俊丰 <467300...@qq.com>
Date: Wed, Dec 4, 2024 at 1:52 AM
Subject: ask quetion
To: apache <apa...@apache.org>



Hello:

              I am a plain people,  i am  interested in the Tomcat
container.

         there are a issue: why user's servlet instance output to browser
client by  "PrintWriter" output object is  not need to set  HTTP response
header "Content-Length" actively,  why tomcat container can automatically

         compute the output message's  byte.

             Thank you.  I am  wait your  reply,   if you have free time.


                                                             Hu



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

Reply via email to