-
1. Re: Jetty add additional stuff inside the response header???
jules Oct 25, 2002 6:43 AM (in response to kenryu)There is a mismatch between the amout of data that you are declaring you are going to send, and the amount of data that you are actually sending - Jetty issues a warning.
It looks like you are setting contentLength to 17 and then sending 19 bytes - hence the warning.
If you set contentLength to the correct value (19), the warning goes away.
What is the problem ?
Do you have to set the contentLength ?
Do you think that Jetty is miscalculating the amount of content that you are actually sending ?
Jules -
2. Re: Jetty add additional stuff inside the response header???
jules Oct 25, 2002 6:46 AM (in response to kenryu)OK - now I've looked at the code snippet !
I suspect that you are probably need to account for a newline and maybe a terminator of some kind at the end of your message - I'll check with the powers-that-be.
Jules -
3. Re: Jetty add additional stuff inside the response header???
gregwilkins Oct 25, 2002 6:53 AM (in response to kenryu)
Or just don't bother setting the content length at all!
Jetty will handle that for you if your client in HTTP/1.1
you only really need to set your own content length if you have lots of http/1.0 clients. -
4. Re: Jetty add additional stuff inside the response header???
kenryu Oct 25, 2002 4:45 PM (in response to kenryu)hi All;
Thank's for the reply. Actually those code above is J2ME code (MIDlet). I'm trying to make a POST Connection with servlet that in turns will make connection to session bean. Have anybody find out about this??Help!
^_^
Thank's -
5. Re: Jetty add additional stuff inside the response header???
kenryu Oct 25, 2002 4:47 PM (in response to kenryu)By the way the reason why I have to add 2 because when I'm sending a message with a length of 17 it will complain : 10:55:35,526 WARN [jbossweb] WARNING: Invalid length: Content-Length=17 written
=19 for http://localhost:8080/
so that's why I decided to add 2 and it will stop complaining. Anybody?? help..:) -
6. Re: Jetty add additional stuff inside the response header???
jules Oct 26, 2002 12:46 PM (in response to kenryu)did you read my answer ?
You are probably adding one byte because you are using printLN which will append a newline.
The other byte is probably a terminator.
As Greg says, there is probably no need for you to explicitly set the ContentLength anyway.
Jules -
7. Re: Jetty add additional stuff inside the response header???
kenryu Oct 27, 2002 12:34 PM (in response to kenryu)hi;
Thank's for replying.. I change the println to print and it fix the problem. Thank you guys , you're awesome...:)
^_^