Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setContentLength()  RSS feed

 
plr kannan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need u r help
response.setContentlength(500);
500 is byte or kb?
say if i sending 1000bytes of data from to the browser.but iam setting the contentlength as 600bytes. 600 bytes get downloaded from servlet1.
still the connection is kept open?
here i requested servlet2 at the same browser window now remaining 400 bytes get downloaded and servlet2 is also sending response !!
what is happening here?
Pl.R.Kannan
------------------
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
content length is in bytes.
The exact behaviour if the numbers don't match depends on the browser or plugin on the client side. Some care - some don't.
The server side does not pay any attention to the number you set.
Bill
------------------
author of:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!