Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setContentLength()

 
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:
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!