Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic