Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet execution

 
Arun Prasath
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will the servlet stop execution, if the response.setContentLength(0); ?
if not, what will happen?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried this?
 
Arun Prasath
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
servlet executes actually well ,when i set content length as 0...?

but i saw in a mock exam that says servlet will stop execution ,if the response.setContentLength(0);

i am confussed.....
what is the answer?
 
Kaustabh Singha Roy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best way would be to create a test servlet, set the response length to 0, add some prints and call it a couple of times. If it works then, just forget the "mock ..." It is working after all.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i saw in a mock exam that says servlet will stop execution ,if the response.setContentLength(0);


You probably didn't notice that the answer to the question is False.

Mock exam questions may include bizarre statements like that which you are supposed to be able to spot. If you were familiar with the servlet API for the HttpServletResponse object you would know that the method only sets a value in a response header.

Bill (who has written lots of bizarre questions for mock exams)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic