wood burning stoves 2.0*
The moose likes Servlets and the fly likes servlet execution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet execution" Watch "servlet execution" New topic
Author

servlet execution

Arun Prasath
Ranch Hand

Joined: Jul 18, 2006
Posts: 60
will the servlet stop execution, if the response.setContentLength(0); ?
if not, what will happen?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Have you tried this?
Arun Prasath
Ranch Hand

Joined: Jul 18, 2006
Posts: 60
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

Joined: Oct 04, 2005
Posts: 43
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

Joined: Mar 22, 2000
Posts: 12761
    
    5
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)
 
Don't get me started about those stupid light bulbs.
 
subject: servlet execution
 
Similar Threads
Forwarding the current page to previous page
Scheduling execution of Servlets ?
destroy method
basic info skipped
Doubt on executing a struts application in jboss server