• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

servlet execution

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
will the servlet stop execution, if the response.setContentLength(0); ?
if not, what will happen?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried this?
 
Arun Prasath
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
reply
    Bookmark Topic Watch Topic
  • New Topic