tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stewart, Daniel J" <>
Subject RE: Tomcat sucks at receiving large messages
Date Tue, 30 Sep 2003 17:57:34 GMT
Here it is:

public class AdapterServlet extends HttpServlet {

public void service(HttpServletRequest req, HttpServletResponse res) {
  BufferedReader reader = req.getReader();
  try {
    char [] charArr = new char[req.getContentLength()];;
    String str = new String(charArr);
    try {
      File f = new File("servlet.out");
      PrintWriter out = new PrintWriter(new FileWriter(f));
    } catch(IOException err { System.err.println(err.toString()); }

  } catch(IOException err) { System.err.println(err.toString()); }

-----Original Message-----
From: Shapira, Yoav [] 
Sent: Tuesday, September 30, 2003 8:34 AM
To: Tomcat Users List
Subject: RE: Tomcat sucks at receiving large messages

Perhaps if you share your servlet which writes the message body to a
file, we could help you write a better servlet ;)

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Stewart, Daniel J []
>Sent: Tuesday, September 30, 2003 11:31 AM
>Subject: Tomcat sucks at receiving large messages
>When receiving a HTTP 1.0 POST with a 10kbyte payload, my doPost() 
>method writes the message body to a file. The file is the right size, 
>but my data is nulled out (set to 0) after correctly receiving about 
>In frustration, I set the Connector bufferSize parameter to "1000000", 
>to discover that I could now receive about 4kbytes of my 10kbyte 
>message. I then proceeded to write my own Java server to receive the 
>message and write it to a file, and it works just fine.
>I am at a loss - can anyone suggest what could be causing this problem?
>Tomcat version: 4.1.27
>Tomcat configuration: Out-of-the-box (except for my app's WEB-INF)
>OS: solaris 2.9
>My servlet skill level: medium-low
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message