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 allowChunking in Tomcat 5.x 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 "allowChunking in Tomcat 5.x" Watch "allowChunking in Tomcat 5.x" New topic
Author

allowChunking in Tomcat 5.x

Kartik Ruppa
Ranch Hand

Joined: Aug 28, 2002
Posts: 60
Hi,

Can "allowChunking" be used as an attribute in Tomcat 5.x ?If not,how to disable chunking in tomcat 5.0 and up?

TIA!
Kartik
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Why do you want to disable chunking?
Are you using something other than a browser to access your app?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Kartik Ruppa
Ranch Hand

Joined: Aug 28, 2002
Posts: 60
Hi Ben,
I am not sure what exactly this parameter can do.But this is based on the article here

http://cafe.bevocal.com/docs/faq/faq.html

Iam usign a voice browser to fetch the docs from tomcat and see bad fetches being thrown.

Based on the above link I mentioned,it looks like bad fetches can be reduced by disabling chunking.

If you have any insight into this,do let me know.

Thanks,
Kartik
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

A while back, I was working with a soap client that couldn't handle chunked responses. I was able to get Tomcat to send unchunked data by changing the HTTP version in the request to HTTP/1.0 (HTTP/1.1 is the default for most browsers these days).
This was done from the client itself, not from within Tomcat.



From: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

HTTP/1.1 and HTTP/1.0 Support

This Connector supports all of the required features of the HTTP/1.1 protocol, as described in RFC 2616, including persistent connections, pipelining, expectations and chunked encoding. If the client (typically a browser) supports only HTTP/1.0, the Connector will gracefully fall back to supporting this protocol as well. No special configuration is required to enable this support. The Connector also supports HTTP/1.0 keep-alive.

RFC 2616 requires that HTTP servers always begin their responses with the highest HTTP version that they claim to support. Therefore, this Connector will always return HTTP/1.1 at the beginning of its responses.


[ October 17, 2006: Message edited by: Ben Souther ]
Keith Furnell
Greenhorn

Joined: Oct 30, 2006
Posts: 1
In response to the original question, I have allowChunking set to false in Tomcat 5.5 and am still seeing chunked transfers.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"allowChunking" isn't mentioned anywhere in the Tomcat 5x documentation.

Looking through the API, I can see that there was was a setAllowChunking and a getAllowChunking method in Tomcat 4.1 but both were deprecated.
http://tomcat.apache.org/tomcat-4.1-doc/catalina/docs/api/org/apache/catalina/connector/http/HttpConnector.html#setAllowChunking(boolean)

Searching the 5.5 documentation for these methods yields nothing.
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/

As I mentioned earlier, the only way I could get Tomcat to send non-chunked data was to make sure the request requests specified HTTP/1.0.
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Ben Souther wrote:A while back, I was working with a soap client that couldn't handle chunked responses. I was able to get Tomcat to send unchunked data by changing the HTTP version in the request to HTTP/1.0 (HTTP/1.1 is the default for most browsers these days).
This was done from the client itself, not from within Tomcat.


Ben, I know this is a really old thread, but can you shed some light on how to set the request's HTTP version to HTTP/1.0 ? A code snippet would be great if you have one.

Thanks,
James
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: allowChunking in Tomcat 5.x
 
Similar Threads
servlet/listener order in deployment descriptor
How to use Tomcat 5.x and WSAD?
Question to Thomas on "Murach Servlets"
Which version of Tomcat to use?
Version issue while deploying