Hi!
You have a little error, you are using ++i instead of i++ on:
for(int i = 0; i < 5; ++i)
The first iteration is a 1 because the increament is done before instead
of after the looping.
/per jonsson
Peter Kennard skrev:
I have some real mysterious behavior, it seems the first chunk just
doesn't
make it into the output. Doesn't matter how long or short it is.
Seems like a BUG unles I'm doing something wrong.
/* in my real tiny test servlet */
public void service( ServletRequest req,
ServletResponse res)
throws IOException, ServletException
{
java.io.OutputStream os = res.getOutputStream();
for(int i = 0; i < 5; ++i)
{
String txt = "Some Text " + i + "\n";
os.write(txt.getBytes());
os.flush();
}
}
/**** the results in a purely socket based client (ie exactly what is
sent
back - all appropriate except the "Some Text 0" is plain missing
!!! */
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Sun, 11 Mar 2007 02:22:52 GMT
c
Some Text 1
c
Some Text 2
c
Some Text 3
c
Some Text 4
0
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]