aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes different ways in which the response can be commited in servlets ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "different ways in which the response can be commited in servlets ??" Watch "different ways in which the response can be commited in servlets ??" New topic
Author

different ways in which the response can be commited in servlets ??

Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188

hi

what are the different ways in which the response can be commited in servlets ??

one method that does this is the flushBuffer() method

Can someone state the other cases in which the response is comitted .... or some logic or rule which helps us predict this ??
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
ServletResponse has a method isCommitted which returns true when the response is committed.

You can check this before setting any response header, codes, forwarding the request or redirecting the request to different url.

Hope this helps your cause..
Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188

Hi

Ya did know of that method ... but the question was from a exam point of view ..what if we are given a code sniplet and asked when the response will be committed ??

So if we could get some rule or logic as to when the response is it would be usefull

Thanks
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Originally posted by sid sree:
Hi

Ya did know of that method ... but the question was from a exam point of view ..what if we are given a code sniplet and asked when the response will be committed ??

So if we could get some rule or logic as to when the response is it would be usefull

Thanks


I think even when you set some headers to the response (like setContentType etc) its like the response is committed. Is that right?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: different ways in which the response can be commited in servlets ??