File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Content Length header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Content Length header" Watch "Content Length header" New topic
Author

Content Length header

Meng Tan
Ranch Hand

Joined: Jan 20, 2001
Posts: 115
Hi,
does anyone know whether Tomcat will send a Content Length header when the response size is smaller than the buffer size?
Thank you.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

No. It's up to the application to set the Content-Length header. In the case of HTML, you don't need to. In the case of PDF, you MUST and it must be CORRECT or Netscape users won't be able to view the document.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Content Length header
 
Similar Threads
Send PDF file to browser for display
How to redirect from servlet to JSP/Servlet with out executing the below code
Input Stream
How to check the file size?
Problem in opening PDF file in client browser